wok diff busybox/stuff/busybox-1.21-cmdline.u @ rev 15390

Up slitaz-boot-scripts (5.3.2)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Oct 30 18:29:11 2013 +0100 (2013-10-30)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/busybox/stuff/busybox-1.21-cmdline.u	Wed Oct 30 18:29:11 2013 +0100
     1.3 @@ -0,0 +1,37 @@
     1.4 +Display command line in usage output. Useful to debug scripts with variables.
     1.5 +--- busybox-1.21.1/libbb/appletlib.c
     1.6 ++++ busybox-1.21.1/libbb/appletlib.c
     1.7 +@@ -93,9 +93,16 @@
     1.8 + 
     1.9 + #endif /* FEATURE_COMPRESS_USAGE */
    1.10 + 
    1.11 +-
    1.12 ++static char **bb_argv;
    1.13 + void FAST_FUNC bb_show_usage(void)
    1.14 + {
    1.15 ++	full_write2_str("\nCommand line: ");
    1.16 ++	while (*bb_argv) {
    1.17 ++		full_write2_str(*bb_argv++);
    1.18 ++		full_write2_str(" ");
    1.19 ++	}
    1.20 ++	full_write2_str("\n\n");
    1.21 ++
    1.22 + 	if (ENABLE_SHOW_USAGE) {
    1.23 + #ifdef SINGLE_APPLET_STR
    1.24 + 		/* Imagine that this applet is "true". Dont suck in printf! */
    1.25 +@@ -612,6 +619,7 @@
    1.26 + /* If we were called as "busybox..." */
    1.27 + static int busybox_main(char **argv)
    1.28 + {
    1.29 ++	bb_argv = argv;
    1.30 + 	if (!argv[1]) {
    1.31 + 		/* Called without arguments */
    1.32 + 		const char *a;
    1.33 +@@ -778,6 +786,7 @@
    1.34 + int main(int argc UNUSED_PARAM, char **argv)
    1.35 + #endif
    1.36 + {
    1.37 ++	bb_argv = argv;
    1.38 + 	/* Tweak malloc for reduced memory consumption */
    1.39 + #ifdef M_TRIM_THRESHOLD
    1.40 + 	/* M_TRIM_THRESHOLD is the maximum amount of freed top-most memory