浏览代码

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) {