diff options
author | Michi Henning <michi@zeroc.com> | 2006-01-20 03:35:13 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2006-01-20 03:35:13 +0000 |
commit | 453b401446bdc8ff9f423440d3a77be9d4fd4def (patch) | |
tree | 2b204896b9c62e4a1754197f75bf856f71a98c25 /cpp/src | |
parent | remove unnecessary subdirs (diff) | |
download | ice-453b401446bdc8ff9f423440d3a77be9d4fd4def.tar.bz2 ice-453b401446bdc8ff9f423440d3a77be9d4fd4def.tar.xz ice-453b401446bdc8ff9f423440d3a77be9d4fd4def.zip |
Bug 789.
Diffstat (limited to 'cpp/src')
-rwxr-xr-x | cpp/src/IceUtil/Options.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/cpp/src/IceUtil/Options.cpp b/cpp/src/IceUtil/Options.cpp index f309f11aeaa..03c11dbe920 100755 --- a/cpp/src/IceUtil/Options.cpp +++ b/cpp/src/IceUtil/Options.cpp @@ -135,12 +135,25 @@ IceUtil::Options::split(const string& line) { // // Ignore a backslash at the end of the string, - // and strip backslash-newline pairs. Anything - // else following a backslash is taken literally. + // and strip backslash-newline pairs. If a + // backslash is followed by a space, we just + // write the space. Anything else following a + // backslash is preserved, including the backslash. + // (This deviates from bash quoting rules, but is + // necessary so we don't drop backslashes from Windows + // path names.) // if(i < l.size() - 1 && l[++i] != '\n') { - arg.push_back(l[i]); + if(l[i] == ' ') + { + arg.push_back(' '); + } + else + { + arg.push_back('\\'); + arg.push_back(l[i]); + } } break; } @@ -371,7 +384,7 @@ IceUtil::Options::split(const string& line) // Bash does not define what should happen if a \c // is not followed by a recognized control character. // We simply treat this case like other unrecognized - // escape sequences, that is, we preserver the escape + // escape sequences, that is, we preserve the escape // sequence unchanged. // arg.push_back('\\'); |