This patch fixes a misbehaviour in the way the escaping is done for commands
given via inputbox or config file. The previous logic for the lhs of a command
used '\' to escape the ' '. But to get a single '\' it's needed to use '\\'.
But the '\\' was not taken as a single backslash.
Now the backslash escapes ' ' as well as '\'. A backslash followed by any
other char is taken as is.
if (!*input) {
/* if input ends here - use only the backslash */
g_string_append_c(arg->lhs, quote);
- } else if (**input == ' ') {
- /* escaped whitespace becomes only whitespace */
+ } else if (**input == ' ' || **input == quote) {
+ /* Escaped whitespace becomes only whitespace and escaped '\'
+ * becomes '\' */
g_string_append_c(arg->lhs, **input);
} else {
/* put escape char and next char into the result string */