[U-Boot] [PATCH 3/3] hush: Include file and line number when reporting syntax errors

Joe Hershberger joe.hershberger at ni.com
Fri Aug 17 22:26:31 CEST 2012


Make debugging script problems easier just like non-u-boot.

Signed-off-by: Joe Hershberger <joe.hershberger at ni.com>
---
 common/hush.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/common/hush.c b/common/hush.c
index 4c84c2f..1db8a53 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -383,9 +383,11 @@ static inline void debug_printf(const char *format, ...) { }
 #define final_printf debug_printf
 
 #ifdef __U_BOOT__
-static void syntax_err(void) {
-	 printf("syntax error\n");
+static void __syntax_err(char *file, int line)
+{
+	 printf("syntax error %s:%d\n", file, line);
 }
+#define syntax_err() __syntax_err(__FILE__, __LINE__)
 #else
 static void __syntax(char *file, int line) {
 	error_msg("syntax error %s:%d", file, line);
-- 
1.7.11.5



More information about the U-Boot mailing list