diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-08-10 00:51:29 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-08-10 00:51:29 +0200 |
commit | b47b3ce1bd651c689fae3cac2760f43f453e2b6e (patch) | |
tree | 792a1710799fbf57c66fa51a642ae6d5074640c5 | |
parent | b347df91317ca05910e930c94fdba30baf9e2de8 (diff) | |
download | busybox-w32-b47b3ce1bd651c689fae3cac2760f43f453e2b6e.tar.gz busybox-w32-b47b3ce1bd651c689fae3cac2760f43f453e2b6e.tar.bz2 busybox-w32-b47b3ce1bd651c689fae3cac2760f43f453e2b6e.zip |
randomconfig fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | archival/tar.c | 2 | ||||
-rw-r--r-- | coreutils/ls.c | 4 | ||||
-rw-r--r-- | libbb/getopt32.c | 6 | ||||
-rw-r--r-- | testsuite/date/date-R-works | 15 | ||||
-rwxr-xr-x | testsuite/ls.tests | 3 | ||||
-rwxr-xr-x | testsuite/mount.tests | 2 | ||||
-rwxr-xr-x | testsuite/od.tests | 4 | ||||
-rwxr-xr-x | testsuite/tar.tests | 4 |
8 files changed, 32 insertions, 8 deletions
diff --git a/archival/tar.c b/archival/tar.c index 3e90d46cb..375e838d2 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -924,7 +924,7 @@ int tar_main(int argc UNUSED_PARAM, char **argv) | |||
924 | /* Prepend '-' to the first argument if required */ | 924 | /* Prepend '-' to the first argument if required */ |
925 | opt_complementary = "--:" // first arg is options | 925 | opt_complementary = "--:" // first arg is options |
926 | "tt:vv:" // count -t,-v | 926 | "tt:vv:" // count -t,-v |
927 | "X::T::" // cumulative lists | 927 | IF_FEATURE_TAR_FROM("X::T::") // cumulative lists |
928 | #if ENABLE_FEATURE_TAR_LONG_OPTIONS && ENABLE_FEATURE_TAR_FROM | 928 | #if ENABLE_FEATURE_TAR_LONG_OPTIONS && ENABLE_FEATURE_TAR_FROM |
929 | "\xff::" // cumulative lists for --exclude | 929 | "\xff::" // cumulative lists for --exclude |
930 | #endif | 930 | #endif |
diff --git a/coreutils/ls.c b/coreutils/ls.c index f11eb4358..d5b25ee70 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
@@ -1111,7 +1111,7 @@ int ls_main(int argc UNUSED_PARAM, char **argv) | |||
1111 | IF_FEATURE_LS_COLOR(applet_long_options = ls_longopts;) | 1111 | IF_FEATURE_LS_COLOR(applet_long_options = ls_longopts;) |
1112 | opt_complementary = | 1112 | opt_complementary = |
1113 | /* -e implies -l */ | 1113 | /* -e implies -l */ |
1114 | "el" | 1114 | IF_FEATURE_LS_TIMESTAMPS("el") |
1115 | /* http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ls.html: | 1115 | /* http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ls.html: |
1116 | * in some pairs of opts, only last one takes effect: | 1116 | * in some pairs of opts, only last one takes effect: |
1117 | */ | 1117 | */ |
@@ -1121,7 +1121,7 @@ int ls_main(int argc UNUSED_PARAM, char **argv) | |||
1121 | ":C-xl:x-Cl:l-xC" /* bycols/bylines/long */ | 1121 | ":C-xl:x-Cl:l-xC" /* bycols/bylines/long */ |
1122 | ":C-1:1-C" /* bycols/oneline */ | 1122 | ":C-1:1-C" /* bycols/oneline */ |
1123 | ":x-1:1-x" /* bylines/oneline (not in SuS, but in GNU coreutils 8.4) */ | 1123 | ":x-1:1-x" /* bylines/oneline (not in SuS, but in GNU coreutils 8.4) */ |
1124 | ":c-u:u-c" /* mtime/atime */ | 1124 | IF_FEATURE_LS_TIMESTAMPS(":c-u:u-c") /* mtime/atime */ |
1125 | /* -w NUM: */ | 1125 | /* -w NUM: */ |
1126 | IF_FEATURE_AUTOWIDTH(":w+"); | 1126 | IF_FEATURE_AUTOWIDTH(":w+"); |
1127 | opt = getopt32(argv, ls_options | 1127 | opt = getopt32(argv, ls_options |
diff --git a/libbb/getopt32.c b/libbb/getopt32.c index c7c4079c2..d0e83d88e 100644 --- a/libbb/getopt32.c +++ b/libbb/getopt32.c | |||
@@ -467,13 +467,17 @@ getopt32(char **argv, const char *applet_opts, ...) | |||
467 | } | 467 | } |
468 | for (on_off = complementary; on_off->opt_char; on_off++) | 468 | for (on_off = complementary; on_off->opt_char; on_off++) |
469 | if (on_off->opt_char == *s) | 469 | if (on_off->opt_char == *s) |
470 | break; | 470 | goto found_opt; |
471 | /* Without this, diagnostic of such bugs is not easy */ | ||
472 | bb_error_msg_and_die("NO OPT %c!", *s); | ||
473 | found_opt: | ||
471 | if (c == ':' && s[2] == ':') { | 474 | if (c == ':' && s[2] == ':') { |
472 | on_off->param_type = PARAM_LIST; | 475 | on_off->param_type = PARAM_LIST; |
473 | continue; | 476 | continue; |
474 | } | 477 | } |
475 | if (c == '+' && (s[2] == ':' || s[2] == '\0')) { | 478 | if (c == '+' && (s[2] == ':' || s[2] == '\0')) { |
476 | on_off->param_type = PARAM_INT; | 479 | on_off->param_type = PARAM_INT; |
480 | s++; | ||
477 | continue; | 481 | continue; |
478 | } | 482 | } |
479 | if (c == ':' || c == '\0') { | 483 | if (c == ':' || c == '\0') { |
diff --git a/testsuite/date/date-R-works b/testsuite/date/date-R-works index d05634456..12f9b96ed 100644 --- a/testsuite/date/date-R-works +++ b/testsuite/date/date-R-works | |||
@@ -5,4 +5,17 @@ while test x"$dt" = x"$dt1"; do | |||
5 | dt="`date -R`" | 5 | dt="`date -R`" |
6 | done | 6 | done |
7 | 7 | ||
8 | test x"$dt" = x"`busybox date -R`" | 8 | bdt=`busybox date -R` |
9 | bdt=`busybox date -R` | ||
10 | bdt=`busybox date -R` | ||
11 | bdt=`busybox date -R` | ||
12 | bdt=`busybox date -R` | ||
13 | |||
14 | # Wtih !FEATURE_DATE_NANO, that is, with time() | ||
15 | # instead of clock_gettime(), seconds transition | ||
16 | # may not happen at _exactly_ the same moment, | ||
17 | # but can be delayed. Several busybox date -R | ||
18 | # invocations above are meant to deal with this. | ||
19 | # (two were enough for me, but I added more just in case). | ||
20 | |||
21 | test x"$dt" = x"$bdt" | ||
diff --git a/testsuite/ls.tests b/testsuite/ls.tests index e2284658d..9309d366b 100755 --- a/testsuite/ls.tests +++ b/testsuite/ls.tests | |||
@@ -256,7 +256,8 @@ mkdir ls.testdir || exit 1 | |||
256 | 256 | ||
257 | # testing "test name" "command" "expected result" "file input" "stdin" | 257 | # testing "test name" "command" "expected result" "file input" "stdin" |
258 | 258 | ||
259 | testing "ls symlink_to_dir" \ | 259 | test x"$CONFIG_FEATURE_LS_SORTFILES" = x"y" \ |
260 | && testing "ls symlink_to_dir" \ | ||
260 | "touch ls.testdir/A ls.testdir/B; ln -s ls.testdir ls.link; ls ls.link; ls -1 ls.link/; ls -1 ls.link; rm -f ls.link" \ | 261 | "touch ls.testdir/A ls.testdir/B; ln -s ls.testdir ls.link; ls ls.link; ls -1 ls.link/; ls -1 ls.link; rm -f ls.link" \ |
261 | "A\nB\nA\nB\nA\nB\n" \ | 262 | "A\nB\nA\nB\nA\nB\n" \ |
262 | "" "" | 263 | "" "" |
diff --git a/testsuite/mount.tests b/testsuite/mount.tests index 58eeb2ec5..9ddd58795 100755 --- a/testsuite/mount.tests +++ b/testsuite/mount.tests | |||
@@ -46,6 +46,7 @@ rm mount.image1m | |||
46 | 46 | ||
47 | 47 | ||
48 | # Bug: mount.shared1 directory shows no files (has to show files a and b) | 48 | # Bug: mount.shared1 directory shows no files (has to show files a and b) |
49 | optional FEATURE_LS_RECURSIVE | ||
49 | testing "mount bind+rshared" "\ | 50 | testing "mount bind+rshared" "\ |
50 | mkdir -p mount.dir mount.shared1 mount.shared2 | 51 | mkdir -p mount.dir mount.shared1 mount.shared2 |
51 | touch mount.dir/a mount.dir/b | 52 | touch mount.dir/a mount.dir/b |
@@ -80,5 +81,6 @@ a | |||
80 | b | 81 | b |
81 | " \ | 82 | " \ |
82 | "" "" | 83 | "" "" |
84 | SKIP= | ||
83 | 85 | ||
84 | exit $FAILCOUNT | 86 | exit $FAILCOUNT |
diff --git a/testsuite/od.tests b/testsuite/od.tests index fa47b4790..7a9da3e97 100755 --- a/testsuite/od.tests +++ b/testsuite/od.tests | |||
@@ -16,7 +16,7 @@ testing "od -b" \ | |||
16 | "" "HELLO" | 16 | "" "HELLO" |
17 | SKIP= | 17 | SKIP= |
18 | 18 | ||
19 | optional DESKTOP | 19 | optional DESKTOP LONG_OPTS |
20 | testing "od -b --traditional" \ | 20 | testing "od -b --traditional" \ |
21 | "od -b --traditional" \ | 21 | "od -b --traditional" \ |
22 | "\ | 22 | "\ |
@@ -26,7 +26,7 @@ testing "od -b --traditional" \ | |||
26 | "" "HELLO" | 26 | "" "HELLO" |
27 | SKIP= | 27 | SKIP= |
28 | 28 | ||
29 | optional DESKTOP | 29 | optional DESKTOP LONG_OPTS |
30 | testing "od -b --traditional FILE" \ | 30 | testing "od -b --traditional FILE" \ |
31 | "od -b --traditional input" \ | 31 | "od -b --traditional input" \ |
32 | "\ | 32 | "\ |
diff --git a/testsuite/tar.tests b/testsuite/tar.tests index 534135df8..39ece5feb 100755 --- a/testsuite/tar.tests +++ b/testsuite/tar.tests | |||
@@ -156,6 +156,7 @@ SKIP= | |||
156 | 156 | ||
157 | # Had a bug where on extract autodetect first "switched off" -z | 157 | # Had a bug where on extract autodetect first "switched off" -z |
158 | # and then failed to recognize .tgz extension | 158 | # and then failed to recognize .tgz extension |
159 | optional FEATURE_TAR_CREATE FEATURE_SEAMLESS_GZ | ||
159 | testing "tar extract tgz" "\ | 160 | testing "tar extract tgz" "\ |
160 | dd count=1 bs=1M if=/dev/zero of=F0 2>/dev/null | 161 | dd count=1 bs=1M if=/dev/zero of=F0 2>/dev/null |
161 | tar -czf F0.tgz F0 | 162 | tar -czf F0.tgz F0 |
@@ -167,8 +168,10 @@ F0 | |||
167 | Ok | 168 | Ok |
168 | " \ | 169 | " \ |
169 | "" "" | 170 | "" "" |
171 | SKIP= | ||
170 | 172 | ||
171 | # On extract, everything up to and including last ".." component is stripped | 173 | # On extract, everything up to and including last ".." component is stripped |
174 | optional FEATURE_TAR_CREATE | ||
172 | testing "tar strips /../ on extract" "\ | 175 | testing "tar strips /../ on extract" "\ |
173 | rm -rf input_* test.tar 2>/dev/null | 176 | rm -rf input_* test.tar 2>/dev/null |
174 | mkdir input_dir | 177 | mkdir input_dir |
@@ -184,6 +187,7 @@ input_dir/file | |||
184 | Ok | 187 | Ok |
185 | " \ | 188 | " \ |
186 | "" "" | 189 | "" "" |
190 | SKIP= | ||
187 | 191 | ||
188 | 192 | ||
189 | cd .. && rm -rf tar.tempdir || exit 1 | 193 | cd .. && rm -rf tar.tempdir || exit 1 |