wok-stable annotate busybox/stuff/busybox-1.18.2-cmdline.u @ rev 8159
Updated busybox for tazwok-experimental.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Wed Jan 26 18:02:11 2011 +0000 (2011-01-26) |
parents | |
children |
rev | line source |
---|---|
slaxemulator@8159 | 1 Display command line in usage output. Useful to debug scripts with variables. |
slaxemulator@8159 | 2 --- busybox-1.18.1/libbb/appletlib.c |
slaxemulator@8159 | 3 +++ busybox-1.18.1/libbb/appletlib.c |
slaxemulator@8159 | 4 @@ -97,9 +97,16 @@ |
slaxemulator@8159 | 5 |
slaxemulator@8159 | 6 #endif /* FEATURE_COMPRESS_USAGE */ |
slaxemulator@8159 | 7 |
slaxemulator@8159 | 8 - |
slaxemulator@8159 | 9 +static char **bb_argv; |
slaxemulator@8159 | 10 void FAST_FUNC bb_show_usage(void) |
slaxemulator@8159 | 11 { |
slaxemulator@8159 | 12 + full_write2_str("\nCommand line: "); |
slaxemulator@8159 | 13 + while (*bb_argv) { |
slaxemulator@8159 | 14 + full_write2_str(*bb_argv++); |
slaxemulator@8159 | 15 + full_write2_str(" "); |
slaxemulator@8159 | 16 + } |
slaxemulator@8159 | 17 + full_write2_str("\n\n"); |
slaxemulator@8159 | 18 + |
slaxemulator@8159 | 19 if (ENABLE_SHOW_USAGE) { |
slaxemulator@8159 | 20 #ifdef SINGLE_APPLET_STR |
slaxemulator@8159 | 21 /* Imagine that this applet is "true". Dont suck in printf! */ |
slaxemulator@8159 | 22 @@ -635,6 +642,7 @@ |
slaxemulator@8159 | 23 /* If we were called as "busybox..." */ |
slaxemulator@8159 | 24 static int busybox_main(char **argv) |
slaxemulator@8159 | 25 { |
slaxemulator@8159 | 26 + bb_argv = argv; |
slaxemulator@8159 | 27 if (!argv[1]) { |
slaxemulator@8159 | 28 /* Called without arguments */ |
slaxemulator@8159 | 29 const char *a; |
slaxemulator@8159 | 30 @@ -785,6 +793,7 @@ |
slaxemulator@8159 | 31 int main(int argc UNUSED_PARAM, char **argv) |
slaxemulator@8159 | 32 #endif |
slaxemulator@8159 | 33 { |
slaxemulator@8159 | 34 + bb_argv = argv; |
slaxemulator@8159 | 35 /* Tweak malloc for reduced memory consumption */ |
slaxemulator@8159 | 36 #ifndef PAGE_SIZE |
slaxemulator@8159 | 37 # define PAGE_SIZE (4*1024) /* guess */ |