[git commit] hush: unify syntax_error_unterm_{ch,str} a bit
Mike Frysinger
vapier at gentoo.org
Mon Jun 1 18:14:36 UTC 2009
commit: http://git.busybox.net/busybox/commit/?id=6a46ab8b8fe3547cf9de4c0ff7e9420d87f8a3cb
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master
Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
shell/hush.c | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/shell/hush.c b/shell/hush.c
index 4c45e65..e3f7b6e 100644
--- a/shell/hush.c
+++ b/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);
}
+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
* even if shell is interactive: EOF while looking for closing
* 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)
{
- char msg[2];
- msg[0] = ch;
- msg[1] = '\0';
- die_if_script(lineno, "syntax error: unterminated %s", msg);
+ char msg[2] = { ch, '\0' };
+ syntax_error_unterm_str(lineno, msg);
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)
{
char msg[2];
--
1.6.0.6
More information about the busybox-cvs
mailing list