mirror of
https://github.com/sheumann/hush.git
synced 2025-03-01 12:30:09 +00:00
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>
This commit is contained in:
parent
dc3bc40578
commit
ef3e7fdd3b
@ -5240,7 +5240,6 @@ static int handle_dollar(o_string *as_string,
|
|||||||
o_string *dest,
|
o_string *dest,
|
||||||
struct in_str *input)
|
struct in_str *input)
|
||||||
{
|
{
|
||||||
int expansion;
|
|
||||||
int ch = i_peek(input); /* first character after the $ */
|
int ch = i_peek(input); /* first character after the $ */
|
||||||
unsigned char quote_mask = dest->o_escape ? 0x80 : 0;
|
unsigned char quote_mask = dest->o_escape ? 0x80 : 0;
|
||||||
|
|
||||||
@ -5279,10 +5278,12 @@ static int handle_dollar(o_string *as_string,
|
|||||||
goto make_one_char_var;
|
goto make_one_char_var;
|
||||||
case '{': {
|
case '{': {
|
||||||
bool first_char, all_digits;
|
bool first_char, all_digits;
|
||||||
|
int expansion;
|
||||||
|
|
||||||
o_addchr(dest, SPECIAL_VAR_SYMBOL);
|
|
||||||
ch = i_getch(input);
|
ch = i_getch(input);
|
||||||
nommu_addchr(as_string, ch);
|
nommu_addchr(as_string, ch);
|
||||||
|
o_addchr(dest, SPECIAL_VAR_SYMBOL);
|
||||||
|
|
||||||
/* TODO: maybe someone will try to escape the '}' */
|
/* TODO: maybe someone will try to escape the '}' */
|
||||||
expansion = 0;
|
expansion = 0;
|
||||||
first_char = true;
|
first_char = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user