From: Thomas Jarosch Date: Tue, 6 Mar 2007 10:47:23 +0000 (+0000) Subject: libi2ncommon: (tomj) escape_shellarg: escape empty strings, fixes backup_push with... X-Git-Tag: v2.6~202 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=0f65241eba4f4257fdd57f08cfd9b0a13e3ebe30;p=libi2ncommon libi2ncommon: (tomj) escape_shellarg: escape empty strings, fixes backup_push with empty password --- diff --git a/src/stringfunc.cpp b/src/stringfunc.cpp index 202761a..c041609 100644 --- 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; }