libi2ncommon: (tomj) escape_shellarg: escape empty strings, fixes backup_push with...
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Tue, 6 Mar 2007 10:47:23 +0000 (10:47 +0000)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Tue, 6 Mar 2007 10:47:23 +0000 (10:47 +0000)
src/stringfunc.cpp

index 202761a..c041609 100644 (file)
@@ -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;
 }