Explorar o código

Const for escaped quoted

git-svn-id: https://klish.googlecode.com/svn/trunk@454 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev %!s(int64=13) %!d(string=hai) anos
pai
achega
0056dd2f47
Modificáronse 3 ficheiros con 3 adicións e 1 borrados
  1. 1 1
      clish/shell/shell_var.c
  2. 1 0
      lub/string.h
  3. 1 0
      lub/string/string_escape.c

+ 1 - 1
clish/shell/shell_var.c

@@ -334,7 +334,7 @@ char *clish_shell_expand_var(const char *name, clish_shell_var_t vtype, void *co
 			if (space) {
 				char *q = NULL;
 				char *tstr;
-				tstr = lub_string_encode(tmp, "\"\\");
+				tstr = lub_string_encode(tmp, lub_string_esc_quoted);
 				lub_string_cat(&q, "\"");
 				lub_string_cat(&q, tstr);
 				lub_string_free(tstr);

+ 1 - 0
lub/string.h

@@ -229,6 +229,7 @@ void lub_string_free(
  */
 extern const char *lub_string_esc_default;
 extern const char *lub_string_esc_regex;
+extern const char *lub_string_esc_quoted;
 
 /**
  * This operation decode the escaped string.

+ 1 - 0
lub/string/string_escape.c

@@ -8,6 +8,7 @@
 
 const char *lub_string_esc_default = "`|$<>&()#;\"\\";
 const char *lub_string_esc_regex = "^$.*+[](){}";
+const char *lub_string_esc_quoted = "\\\"";
 
 /*--------------------------------------------------------- */
 char *lub_string_ndecode(const char *string, unsigned int len)