diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-06-01 14:13:39 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-06-01 14:16:43 -0400 |
commit | ef3e7fdd3b18ef3c43a58a06251eaf615e18a789 (patch) | |
tree | a538aab54f813db9c77876743958bc9192dee40c /shell | |
parent | dc3bc40578e0d9a4f4437d5b9018c1dd02900584 (diff) | |
download | busybox-w32-ef3e7fdd3b18ef3c43a58a06251eaf615e18a789.tar.gz busybox-w32-ef3e7fdd3b18ef3c43a58a06251eaf615e18a789.tar.bz2 busybox-w32-ef3e7fdd3b18ef3c43a58a06251eaf615e18a789.zip |
hush: push down expansion var in handle_dollar()
Declare the variable in the scope it is used rather than the entire
function scope so it's obvious it is only used there.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'shell')
-rw-r--r-- | shell/hush.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/shell/hush.c b/shell/hush.c index b5cf86132..4c45e6559 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -5240,7 +5240,6 @@ static int handle_dollar(o_string *as_string, | |||
5240 | o_string *dest, | 5240 | o_string *dest, |
5241 | struct in_str *input) | 5241 | struct in_str *input) |
5242 | { | 5242 | { |
5243 | int expansion; | ||
5244 | int ch = i_peek(input); /* first character after the $ */ | 5243 | int ch = i_peek(input); /* first character after the $ */ |
5245 | unsigned char quote_mask = dest->o_escape ? 0x80 : 0; | 5244 | unsigned char quote_mask = dest->o_escape ? 0x80 : 0; |
5246 | 5245 | ||
@@ -5279,10 +5278,12 @@ static int handle_dollar(o_string *as_string, | |||
5279 | goto make_one_char_var; | 5278 | goto make_one_char_var; |
5280 | case '{': { | 5279 | case '{': { |
5281 | bool first_char, all_digits; | 5280 | bool first_char, all_digits; |
5281 | int expansion; | ||
5282 | 5282 | ||
5283 | o_addchr(dest, SPECIAL_VAR_SYMBOL); | ||
5284 | ch = i_getch(input); | 5283 | ch = i_getch(input); |
5285 | nommu_addchr(as_string, ch); | 5284 | nommu_addchr(as_string, ch); |
5285 | o_addchr(dest, SPECIAL_VAR_SYMBOL); | ||
5286 | |||
5286 | /* TODO: maybe someone will try to escape the '}' */ | 5287 | /* TODO: maybe someone will try to escape the '}' */ |
5287 | expansion = 0; | 5288 | expansion = 0; |
5288 | first_char = true; | 5289 | first_char = true; |