Browse Source

Exclamation sign instead #. The backslash and # have a legacy behaviour

git-svn-id: https://klish.googlecode.com/svn/trunk@543 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev 12 years ago
parent
commit
d28c936420
1 changed files with 4 additions and 2 deletions
  1. 4 2
      clish/shell/shell_var.c

+ 4 - 2
clish/shell/shell_var.c

@@ -235,9 +235,11 @@ static char *expand_nextsegment(const char **string, const char *escape_chars,
 					if ('#' == *q) {
 						mod_quote = 1;
 						mod_esc = 1;
-						mod_esc_chars = 0;
 					} else if ('\\' == *q) {
 						mod_esc = 1;
+					} else if ('!' == *q) {
+						mod_quote = 1;
+						mod_esc = 1;
 						mod_esc_chars = 0;
 					} else if (('_' == *q) && ('_' == *(q+1))) {
 						mod_esc_dec = 1;
@@ -377,7 +379,7 @@ char *clish_shell__get_params(clish_context_t *context)
 		parg = clish_pargv__get_parg(pargv, i);
 		if (request)
 			lub_string_cat(&request, " ");
-		lub_string_cat(&request, "${#");
+		lub_string_cat(&request, "${!");
 		lub_string_cat(&request, clish_parg__get_name(parg));
 		lub_string_cat(&request, "}");
 	}