git://developer.intra2net.com
/
libi2ncommon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
20a7947
)
libi2ncommon: (tomj) escape_shellarg: escape empty strings, fixes backup_push with...
author
Thomas Jarosch
<thomas.jarosch@intra2net.com>
Tue, 6 Mar 2007 10:47:23 +0000 (10:47 +0000)
committer
Thomas Jarosch
<thomas.jarosch@intra2net.com>
Tue, 6 Mar 2007 10:47:23 +0000 (10:47 +0000)
src/stringfunc.cpp
patch
|
blob
|
blame
|
history
diff --git
a/src/stringfunc.cpp
b/src/stringfunc.cpp
index
202761a
..
c041609
100644
(file)
--- a/
src/stringfunc.cpp
+++ b/
src/stringfunc.cpp
@@
-456,18
+456,15
@@
string descape(const string &s, int startpos, int &endpos)
string escape_shellarg(const string &input)
{
- if (!input.size())
- return "";
-
string output = "'";
string::const_iterator it, it_end = input.end();
for (it = input.begin(); it != it_end; it++) {
if ((*it) == '\'')
output += "'\\'";
-
+
output += *it;
}
-
+
output += "'";
return output;
}