From ff031c0b466617d5bceea1de81eb057da0afa40a Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Wed, 21 May 2014 12:06:04 +0200 Subject: [PATCH] changed escaping of shell args in status notifier command: escape each arg separately instead of the whole argument string at once --- src/link/statusnotifiercommand.cpp | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/link/statusnotifiercommand.cpp b/src/link/statusnotifiercommand.cpp index 3b9cb51..3372e8c 100644 --- a/src/link/statusnotifiercommand.cpp +++ b/src/link/statusnotifiercommand.cpp @@ -24,6 +24,7 @@ on this file might be covered by the GNU General Public License. #include #include +#include #include #include @@ -133,8 +134,10 @@ string StatusNotifierCommand::get_arguments_string() const // retrieve the arguments string from within the command string const size_t args_begin_pos = CommandStr.find( " " ) + 1; const size_t args_end_pos = CommandStr.length(); - string args = CommandStr.substr( args_begin_pos, args_end_pos ); - args = escape_shellarg( args ); - - return args; + std::list< string > args = I2n::split_string( + CommandStr.substr( args_begin_pos, args_end_pos ), + " ", true); + BOOST_FOREACH( string arg, args ) + arg = escape_shellarg( arg ); + return I2n::join_string( args, " " ); } -- 1.7.1