svn commit: [25863] trunk/busybox/shell
vapier at busybox.net
vapier at busybox.net
Sat Mar 28 19:09:05 UTC 2009
Author: vapier
Date: 2009-03-28 19:09:04 +0000 (Sat, 28 Mar 2009)
New Revision: 25863
Log:
update the normally disabled debug code around the syntax() func to use new maybe_die()
Modified:
trunk/busybox/shell/hush.c
Changeset:
Modified: trunk/busybox/shell/hush.c
===================================================================
--- trunk/busybox/shell/hush.c 2009-03-28 19:08:23 UTC (rev 25862)
+++ trunk/busybox/shell/hush.c 2009-03-28 19:09:04 UTC (rev 25863)
@@ -588,7 +588,6 @@
};
-#if 1
/* Normal */
static void maybe_die(const char *notice, const char *msg)
{
@@ -601,24 +600,14 @@
#endif
fp(msg ? "%s: %s" : notice, notice, msg);
}
-static void syntax(const char *msg)
-{
- maybe_die("syntax error", msg);
-}
+#if 1
+#define syntax(msg) maybe_die("syntax error", msg);
#else
-/* Debug */
-static void syntax_lineno(int line)
-{
-#if ENABLE_HUSH_INTERACTIVE
- void FAST_FUNC (*fp)(const char *s, ...);
- fp = (G.interactive_fd ? bb_error_msg : bb_error_msg_and_die);
- fp("syntax error hush.c:%d", line);
-#else
- bb_error_msg_and_die("syntax error hush.c:%d", line);
+/* Debug -- trick gcc to expand __LINE__ and convert to string */
+#define __syntax(msg, line) maybe_die("syntax error hush.c:" # line, msg)
+#define _syntax(msg, line) __syntax(msg, line)
+#define syntax(msg) _syntax(msg, __LINE__)
#endif
-}
-#define syntax(str) syntax_lineno(__LINE__)
-#endif
static int glob_needed(const char *s)
{
More information about the busybox-cvs
mailing list