From 0f65241eba4f4257fdd57f08cfd9b0a13e3ebe30 Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Tue, 6 Mar 2007 10:47:23 +0000 Subject: [PATCH] libi2ncommon: (tomj) escape_shellarg: escape empty strings, fixes backup_push with empty password --- src/stringfunc.cpp | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) 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; } -- 1.7.1