Some people like to use ${?} rather than $?, so make sure we support all
the special single char vars that use this form.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
all_digits = true;
goto char_ok;
}
+ /* They're being verbose and doing ${?} */
+ if (i_peek(input) == '}' && strchr("$!?#*@_", ch))
+ goto char_ok;
}
if (expansion < 2
hush: syntax error: unterminated ${name}
-hush: syntax error: unterminated ${name}
0
0
_
# do all of these in subshells since it's supposed to error out
# first try some invalid patterns
-"$THIS_SH" -c 'echo ${?}'
+#"$THIS_SH" -c 'echo ${?}' -- this is valid as it's the same as $?
"$THIS_SH" -c 'echo ${:?}'
# then some funky ones
http://busybox.net
http://busybox.net_abc
-1
-1
+1 1
+1 1
echo ${URL}_abc
true
-false; echo $?
+false; echo $? ${?}
true
-{ false; echo $?; }
+{ false; echo $? ${?}; }
hush: syntax error: unterminated ${name}
hush: syntax error: unterminated ${name}
-hush: syntax error: unterminated ${name}
# reject invalid vars
"$THIS_SH" -c 'echo ${1q}'
"$THIS_SH" -c 'echo ${&}'
-"$THIS_SH" -c 'echo ${$}'
+#"$THIS_SH" -c 'echo ${$}' -- this is valid as it's the same as $$