aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-03-28 19:09:04 +0000
committerMike Frysinger <vapier@gentoo.org>2009-03-28 19:09:04 +0000
commit5a82845f60b2be8e1b85bed08851c794aa188a39 (patch)
treeebc3c83b6d241ea50bbf8ed7145fb0c52026372f
parenta2333c8938af4829a8eac8c09615e6652cd412f1 (diff)
downloadbusybox-w32-5a82845f60b2be8e1b85bed08851c794aa188a39.tar.gz
busybox-w32-5a82845f60b2be8e1b85bed08851c794aa188a39.tar.bz2
busybox-w32-5a82845f60b2be8e1b85bed08851c794aa188a39.zip
update the normally disabled debug code around the syntax() func to use new maybe_die()
-rw-r--r--shell/hush.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 84dd9e13c..3ab96a323 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -588,7 +588,6 @@ static const struct built_in_command bltins[] = {
588}; 588};
589 589
590 590
591#if 1
592/* Normal */ 591/* Normal */
593static void maybe_die(const char *notice, const char *msg) 592static void maybe_die(const char *notice, const char *msg)
594{ 593{
@@ -601,23 +600,13 @@ static void maybe_die(const char *notice, const char *msg)
601#endif 600#endif
602 fp(msg ? "%s: %s" : notice, notice, msg); 601 fp(msg ? "%s: %s" : notice, notice, msg);
603} 602}
604static void syntax(const char *msg) 603#if 1
605{ 604#define syntax(msg) maybe_die("syntax error", msg);
606 maybe_die("syntax error", msg);
607}
608#else
609/* Debug */
610static void syntax_lineno(int line)
611{
612#if ENABLE_HUSH_INTERACTIVE
613 void FAST_FUNC (*fp)(const char *s, ...);
614 fp = (G.interactive_fd ? bb_error_msg : bb_error_msg_and_die);
615 fp("syntax error hush.c:%d", line);
616#else 605#else
617 bb_error_msg_and_die("syntax error hush.c:%d", line); 606/* Debug -- trick gcc to expand __LINE__ and convert to string */
618#endif 607#define __syntax(msg, line) maybe_die("syntax error hush.c:" # line, msg)
619} 608#define _syntax(msg, line) __syntax(msg, line)
620#define syntax(str) syntax_lineno(__LINE__) 609#define syntax(msg) _syntax(msg, __LINE__)
621#endif 610#endif
622 611
623static int glob_needed(const char *s) 612static int glob_needed(const char *s)