mirror of https://github.com/mirror/busybox.git
hush: unify syntax_error_unterm_{ch,str} a bit
Signed-off-by: Mike Frysinger <vapier@gentoo.org>1_15_stable
parent
ef3e7fdd3b
commit
6a46ab8b8f
16
shell/hush.c
16
shell/hush.c
|
@ -771,6 +771,11 @@ static void syntax_error_at(unsigned lineno, const char *msg)
|
||||||
die_if_script(lineno, "syntax error at '%s'", msg);
|
die_if_script(lineno, "syntax error at '%s'", msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void syntax_error_unterm_str(unsigned lineno, const char *s)
|
||||||
|
{
|
||||||
|
die_if_script(lineno, "syntax error: unterminated %s", s);
|
||||||
|
}
|
||||||
|
|
||||||
/* It so happens that all such cases are totally fatal
|
/* It so happens that all such cases are totally fatal
|
||||||
* even if shell is interactive: EOF while looking for closing
|
* even if shell is interactive: EOF while looking for closing
|
||||||
* delimiter. There is nowhere to read stuff from after that,
|
* delimiter. There is nowhere to read stuff from after that,
|
||||||
|
@ -779,18 +784,11 @@ static void syntax_error_at(unsigned lineno, const char *msg)
|
||||||
static void syntax_error_unterm_ch(unsigned lineno, char ch) NORETURN;
|
static void syntax_error_unterm_ch(unsigned lineno, char ch) NORETURN;
|
||||||
static void syntax_error_unterm_ch(unsigned lineno, char ch)
|
static void syntax_error_unterm_ch(unsigned lineno, char ch)
|
||||||
{
|
{
|
||||||
char msg[2];
|
char msg[2] = { ch, '\0' };
|
||||||
msg[0] = ch;
|
syntax_error_unterm_str(lineno, msg);
|
||||||
msg[1] = '\0';
|
|
||||||
die_if_script(lineno, "syntax error: unterminated %s", msg);
|
|
||||||
xfunc_die();
|
xfunc_die();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void syntax_error_unterm_str(unsigned lineno, const char *s)
|
|
||||||
{
|
|
||||||
die_if_script(lineno, "syntax error: unterminated %s", s);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void syntax_error_unexpected_ch(unsigned lineno, int ch)
|
static void syntax_error_unexpected_ch(unsigned lineno, int ch)
|
||||||
{
|
{
|
||||||
char msg[2];
|
char msg[2];
|
||||||
|
|
Loading…
Reference in New Issue