From 2c30387a91870052364cee3bdbd6526d5e3dd514 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sun, 8 Mar 2009 16:43:40 +0100 Subject: [PATCH] limit scope of unallowed_chars and make it static --- src/misc.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/misc.cpp b/src/misc.cpp index 36dbdb4f..b5c543a2 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -23,11 +23,6 @@ #include "misc.h" -namespace -{ - const std::string unallowed_chars = "\"*/:<>?\\|"; -} - void ToLower(std::string &s) { transform(s.begin(), s.end(), s.begin(), tolower); @@ -180,6 +175,8 @@ MPD::Song::SetFunction IntoSetFunction(mpd_TagItems tag) void EscapeUnallowedChars(std::string &s) { + static const std::string unallowed_chars = "\"*/:<>?\\|"; + for (std::string::const_iterator it = unallowed_chars.begin(); it != unallowed_chars.end(); it++) { for (size_t i = 0; i < s.length(); i++)