aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-04-19 03:38:01 +0000
committerErik Andersen <andersen@codepoet.org>2000-04-19 03:38:01 +0000
commita3e57ca7008cbaf612675b9de3dd18109f8150de (patch)
treed785d0e01aed700b2af875e6e11e768a1cb030b5
parentf13df3752cd5077622201e6b69c71cd7cd5095a4 (diff)
downloadbusybox-w32-a3e57ca7008cbaf612675b9de3dd18109f8150de.tar.gz
busybox-w32-a3e57ca7008cbaf612675b9de3dd18109f8150de.tar.bz2
busybox-w32-a3e57ca7008cbaf612675b9de3dd18109f8150de.zip
make ps accept (and ignore) all options (--help works of course).
tar now works with or without the leading "-" on the options. -Erik
-rw-r--r--Changelog2
-rw-r--r--Makefile4
-rw-r--r--archival/tar.c7
-rw-r--r--procps/ps.c3
-rw-r--r--ps.c3
-rw-r--r--tar.c7
6 files changed, 14 insertions, 12 deletions
diff --git a/Changelog b/Changelog
index e9d260593..d6f7a489c 100644
--- a/Changelog
+++ b/Changelog
@@ -55,6 +55,8 @@
55 * Fixed a bug where "sed 's/foo/bar/g'" (i.e. a script w/o a "-e") 55 * Fixed a bug where "sed 's/foo/bar/g'" (i.e. a script w/o a "-e")
56 * ps now supports BB_FEATURE_AUTOWIDTH, and can adjust its width 56 * ps now supports BB_FEATURE_AUTOWIDTH, and can adjust its width
57 to match the terminal (defaults to width=79 when this is off). 57 to match the terminal (defaults to width=79 when this is off).
58 * ps now accepts (and ignores) all options except for "--help" (which
59 as would be expected displays help).
58 * Fixed mount'ing loop devices when the filesystem type was not 60 * Fixed mount'ing loop devices when the filesystem type was not
59 specified. It used to revert to non-loop after the first try. 61 specified. It used to revert to non-loop after the first try.
60 * all mallocs now use xmalloc (and so are OOM error safe), and 62 * all mallocs now use xmalloc (and so are OOM error safe), and
diff --git a/Makefile b/Makefile
index 30fd718f1..6a4b41b01 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,7 @@ export VERSION
26# Set the following to `true' to make a debuggable build. 26# Set the following to `true' to make a debuggable build.
27# Leave this set to `false' for production use. 27# Leave this set to `false' for production use.
28# eg: `make DODEBUG=true tests' 28# eg: `make DODEBUG=true tests'
29DODEBUG = false 29DODEBUG = true
30 30
31# If you want a static binary, turn this on. 31# If you want a static binary, turn this on.
32DOSTATIC = false 32DOSTATIC = false
@@ -108,7 +108,7 @@ docs:
108 $(MAKE) -C docs 108 $(MAKE) -C docs
109 109
110regexp.o nfsmount.o: %.o: %.h 110regexp.o nfsmount.o: %.o: %.h
111$(OBJECTS): %.o: busybox.def.h internal.h %.c 111$(OBJECTS): %.o: busybox.def.h internal.h %.c Makefile
112 112
113test tests: 113test tests:
114 cd tests && $(MAKE) all 114 cd tests && $(MAKE) all
diff --git a/archival/tar.c b/archival/tar.c
index 9b3cb7d81..2284fd06d 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -70,13 +70,13 @@ static const char tar_usage[] =
70#endif 70#endif
71 "\tx\t\textract\n" 71 "\tx\t\textract\n"
72 "\tt\t\tlist\n" 72 "\tt\t\tlist\n"
73 "File selection:\n" 73 "\nFile selection:\n"
74 "\tf\t\tname of tarfile or \"-\" for stdin\n" 74 "\tf\t\tname of tarfile or \"-\" for stdin\n"
75 "\tO\t\textract to stdout\n" 75 "\tO\t\textract to stdout\n"
76#if defined BB_FEATURE_TAR_EXCLUDE 76#if defined BB_FEATURE_TAR_EXCLUDE
77 "\t--exclude\tfile to exclude\n" 77 "\t--exclude\tfile to exclude\n"
78#endif 78#endif
79 "Informative output:\n" 79 "\nInformative output:\n"
80 "\tv\t\tverbosely list files processed\n" 80 "\tv\t\tverbosely list files processed\n"
81 ; 81 ;
82 82
@@ -184,7 +184,7 @@ extern int tar_main(int argc, char **argv)
184 usage(tar_usage); 184 usage(tar_usage);
185 185
186 /* Parse any options */ 186 /* Parse any options */
187 while (--argc > 0 && **(++argv) == '-') { 187 while (--argc > 0 && (**(++argv) != '\0')) {
188 stopIt=FALSE; 188 stopIt=FALSE;
189 while (stopIt==FALSE && *(++(*argv))) { 189 while (stopIt==FALSE && *(++(*argv))) {
190 switch (**argv) { 190 switch (**argv) {
@@ -245,7 +245,6 @@ extern int tar_main(int argc, char **argv)
245 break; 245 break;
246 } 246 }
247#endif 247#endif
248 usage(tar_usage);
249 break; 248 break;
250 249
251 default: 250 default:
diff --git a/procps/ps.c b/procps/ps.c
index 1b3f4fb6c..8d59700fd 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -128,8 +128,9 @@ extern int ps_main(int argc, char **argv)
128 128
129 129
130 130
131 if (argc > 1 && **(argv + 1) == '-') 131 if (argc > 1 && strcmp(argv[1], "--help") == 0) {
132 usage ("ps\n\nReport process status\n\nThis version of ps accepts no options.\n"); 132 usage ("ps\n\nReport process status\n\nThis version of ps accepts no options.\n");
133 }
133 134
134 dir = opendir("/proc"); 135 dir = opendir("/proc");
135 if (!dir) 136 if (!dir)
diff --git a/ps.c b/ps.c
index 1b3f4fb6c..8d59700fd 100644
--- a/ps.c
+++ b/ps.c
@@ -128,8 +128,9 @@ extern int ps_main(int argc, char **argv)
128 128
129 129
130 130
131 if (argc > 1 && **(argv + 1) == '-') 131 if (argc > 1 && strcmp(argv[1], "--help") == 0) {
132 usage ("ps\n\nReport process status\n\nThis version of ps accepts no options.\n"); 132 usage ("ps\n\nReport process status\n\nThis version of ps accepts no options.\n");
133 }
133 134
134 dir = opendir("/proc"); 135 dir = opendir("/proc");
135 if (!dir) 136 if (!dir)
diff --git a/tar.c b/tar.c
index 9b3cb7d81..2284fd06d 100644
--- a/tar.c
+++ b/tar.c
@@ -70,13 +70,13 @@ static const char tar_usage[] =
70#endif 70#endif
71 "\tx\t\textract\n" 71 "\tx\t\textract\n"
72 "\tt\t\tlist\n" 72 "\tt\t\tlist\n"
73 "File selection:\n" 73 "\nFile selection:\n"
74 "\tf\t\tname of tarfile or \"-\" for stdin\n" 74 "\tf\t\tname of tarfile or \"-\" for stdin\n"
75 "\tO\t\textract to stdout\n" 75 "\tO\t\textract to stdout\n"
76#if defined BB_FEATURE_TAR_EXCLUDE 76#if defined BB_FEATURE_TAR_EXCLUDE
77 "\t--exclude\tfile to exclude\n" 77 "\t--exclude\tfile to exclude\n"
78#endif 78#endif
79 "Informative output:\n" 79 "\nInformative output:\n"
80 "\tv\t\tverbosely list files processed\n" 80 "\tv\t\tverbosely list files processed\n"
81 ; 81 ;
82 82
@@ -184,7 +184,7 @@ extern int tar_main(int argc, char **argv)
184 usage(tar_usage); 184 usage(tar_usage);
185 185
186 /* Parse any options */ 186 /* Parse any options */
187 while (--argc > 0 && **(++argv) == '-') { 187 while (--argc > 0 && (**(++argv) != '\0')) {
188 stopIt=FALSE; 188 stopIt=FALSE;
189 while (stopIt==FALSE && *(++(*argv))) { 189 while (stopIt==FALSE && *(++(*argv))) {
190 switch (**argv) { 190 switch (**argv) {
@@ -245,7 +245,6 @@ extern int tar_main(int argc, char **argv)
245 break; 245 break;
246 } 246 }
247#endif 247#endif
248 usage(tar_usage);
249 break; 248 break;
250 249
251 default: 250 default: