1
0
Преглед на файлове

Escape backslashes within args

Serj Kalichev преди 6 години
родител
ревизия
995e0e0d8f
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      clish/shell/shell_parse.c

+ 2 - 1
clish/shell/shell_parse.c

@@ -298,7 +298,8 @@ clish_pargv_status_e clish_shell_parse_pargv(clish_pargv_t *pargv,
 				lub_string_cat(&args, "\"");
 			}
 			/* place the current argument in the string */
-			enc = lub_string_encode(arg, "\"");
+			/* Escape quote and backslash */
+			enc = lub_string_encode(arg, lub_string_esc_quoted);
 			lub_string_cat(&args, enc);
 			lub_string_free(enc);
 			if (BOOL_TRUE == quoted) {