[BusyBox] little patch to display CMD line on error.

tomasz motylewski T.Motylewski at bfad.de
Thu Nov 22 01:34:49 UTC 2001


I have found it useful to display the whole command line when busybox does not
understand some command - it makes much easier finding the problem in start-up
scripts.

The included patch does just that.

Best regards,
--
Tomasz Motylewski

diff -ur busybox-0.60.0/busybox.c busybox-0.60.0.1/busybox.c
--- busybox-0.60.0/busybox.c	Thu Jun 21 06:56:24 2001
+++ busybox-0.60.0.1/busybox.c	Tue Aug 21 11:50:42 2001
@@ -96,6 +96,7 @@
 int busybox_main(int argc, char **argv)
 {
 	int col = 0, len, i;
+	int orig_argc=argc;
 
 #ifdef BB_FEATURE_INSTALLER	
 	/* 
@@ -151,7 +152,11 @@
 				col = 0;
 			}
 		}
-		fprintf(stderr, "\n\n");
+		fprintf(stderr, "\n\nBusybox was called as:\n");
+		for(i=0; i<orig_argc; i++) {
+			fprintf(stderr, "%s ", argv[i]);
+		}
+		fprintf(stderr, "\n");
 		exit(0);
 	}
 






More information about the busybox mailing list