diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2008-11-07 11:29:35 -0330 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2008-11-07 11:29:35 -0330 |
commit | 5129377a9d7ea4fcb9809be9022d4cff3cef896e (patch) | |
tree | 072a249461de5d7e1428c53f51aa08f03e8fae16 /cpp/src/IceGrid/Util.cpp | |
parent | Bug 3415 (diff) | |
download | ice-5129377a9d7ea4fcb9809be9022d4cff3cef896e.tar.bz2 ice-5129377a9d7ea4fcb9809be9022d4cff3cef896e.tar.xz ice-5129377a9d7ea4fcb9809be9022d4cff3cef896e.zip |
Bug 3529
Diffstat (limited to 'cpp/src/IceGrid/Util.cpp')
-rw-r--r-- | cpp/src/IceGrid/Util.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cpp/src/IceGrid/Util.cpp b/cpp/src/IceGrid/Util.cpp index d3b6b998738..704f093f24a 100644 --- a/cpp/src/IceGrid/Util.cpp +++ b/cpp/src/IceGrid/Util.cpp @@ -100,14 +100,23 @@ IceGrid::createProperty(const string& name, const string& value) string IceGrid::escapeProperty(const string& s) { + size_t firstChar = s.find_first_not_of(' '); + size_t lastChar = s.find_last_not_of(' '); string result; for(unsigned int i = 0; i < s.size(); ++i) { char c = s[i]; switch(c) { - case '\\': case ' ': + if(i < firstChar || i > lastChar) + { + result.push_back('\\'); + } + result.push_back(c); + break; + + case '\\': case '#': case '=': result.push_back('\\'); |