Browse Source

Use ^ symbol to don't escape VAR

Serj Kalichev 11 years ago
parent
commit
f9aafd376f
1 changed files with 6 additions and 0 deletions
  1. 6 0
      clish/shell/shell_var.c

+ 6 - 0
clish/shell/shell_var.c

@@ -251,10 +251,16 @@ static char *expand_nextsegment(const char **string, const char *escape_chars,
 					} else if ('~' == *q) {
 						mod_esc = 1;
 						mod_esc_chars = 0;
+					/* Internal automatic variable like ${__line} */
 					} else if (('_' == *q) && ('_' == *(q+1))) {
 						mod_esc_dec = 1;
 						q++;
 						break;
+					/* No escaping at all. Usefull for macros VAR */
+					} else if ('^' == *q) {
+						mod_quote = 0;
+						mod_esc = 0;
+						mod_esc_chars = 0;
 					} else
 						break;
 					q++;