aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-07-05 21:37:12 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-07-05 21:37:12 +0200
commit9297dbc9d285e823af59c443e0123cb99577569a (patch)
tree134bb16eaaa4f0a7148aed3a78c7c797108e6568
parent08f0b784fd4351929090c877605762d664e70098 (diff)
downloadbusybox-w32-9297dbc9d285e823af59c443e0123cb99577569a.tar.gz
busybox-w32-9297dbc9d285e823af59c443e0123cb99577569a.tar.bz2
busybox-w32-9297dbc9d285e823af59c443e0123cb99577569a.zip
randomconfig fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--applets/applets.c2
-rw-r--r--archival/bbunzip.c2
-rw-r--r--archival/libunarchive/Kbuild.src1
-rw-r--r--libbb/appletlib.c6
-rw-r--r--shell/hush.c18
-rwxr-xr-xtestsuite/ash.tests1
-rwxr-xr-xtestsuite/cal.tests1
-rwxr-xr-xtestsuite/cpio.tests2
-rw-r--r--testsuite/date/date-works-12
-rwxr-xr-xtestsuite/expand.tests7
-rwxr-xr-xtestsuite/fold.tests7
-rwxr-xr-xtestsuite/ls.tests8
-rwxr-xr-xtestsuite/mount.tests1
-rwxr-xr-xtestsuite/unexpand.tests6
14 files changed, 39 insertions, 25 deletions
diff --git a/applets/applets.c b/applets/applets.c
index 133a21575..6a3996272 100644
--- a/applets/applets.c
+++ b/applets/applets.c
@@ -6,8 +6,6 @@
6 * 6 *
7 * Licensed under GPLv2, see file License in this tarball for details. 7 * Licensed under GPLv2, see file License in this tarball for details.
8 */ 8 */
9
10#include <assert.h>
11#include "busybox.h" 9#include "busybox.h"
12 10
13#if ENABLE_BUILD_LIBBUSYBOX 11#if ENABLE_BUILD_LIBBUSYBOX
diff --git a/archival/bbunzip.c b/archival/bbunzip.c
index 832a7bbf3..c1259ac46 100644
--- a/archival/bbunzip.c
+++ b/archival/bbunzip.c
@@ -387,7 +387,7 @@ IF_DESKTOP(long long) int FAST_FUNC unpack_unxz(unpack_info_t *info UNUSED_PARAM
387int unxz_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 387int unxz_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
388int unxz_main(int argc UNUSED_PARAM, char **argv) 388int unxz_main(int argc UNUSED_PARAM, char **argv)
389{ 389{
390 int opts = getopt32(argv, "cfvdt"); 390 IF_XZ(int opts =) getopt32(argv, "cfvdt");
391# if ENABLE_XZ 391# if ENABLE_XZ
392 /* xz without -d or -t? */ 392 /* xz without -d or -t? */
393 if (applet_name[2] == '\0' && !(opts & (OPT_DECOMPRESS|OPT_TEST))) 393 if (applet_name[2] == '\0' && !(opts & (OPT_DECOMPRESS|OPT_TEST)))
diff --git a/archival/libunarchive/Kbuild.src b/archival/libunarchive/Kbuild.src
index 6ad1d7a65..a8549570e 100644
--- a/archival/libunarchive/Kbuild.src
+++ b/archival/libunarchive/Kbuild.src
@@ -38,6 +38,7 @@ INSERT
38lib-$(CONFIG_AR) += get_header_ar.o unpack_ar_archive.o 38lib-$(CONFIG_AR) += get_header_ar.o unpack_ar_archive.o
39lib-$(CONFIG_BUNZIP2) += decompress_bunzip2.o 39lib-$(CONFIG_BUNZIP2) += decompress_bunzip2.o
40lib-$(CONFIG_UNLZMA) += decompress_unlzma.o 40lib-$(CONFIG_UNLZMA) += decompress_unlzma.o
41lib-$(CONFIG_UNXZ) += decompress_unxz.o
41lib-$(CONFIG_CPIO) += get_header_cpio.o 42lib-$(CONFIG_CPIO) += get_header_cpio.o
42lib-$(CONFIG_DPKG) += $(DPKG_FILES) 43lib-$(CONFIG_DPKG) += $(DPKG_FILES)
43lib-$(CONFIG_DPKG_DEB) += $(DPKG_FILES) 44lib-$(CONFIG_DPKG_DEB) += $(DPKG_FILES)
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 6f058bcc8..4924a97c1 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -195,7 +195,11 @@ void lbb_prepare(const char *applet
195#if ENABLE_FEATURE_INDIVIDUAL 195#if ENABLE_FEATURE_INDIVIDUAL
196 /* Redundant for busybox (run_applet_and_exit covers that case) 196 /* Redundant for busybox (run_applet_and_exit covers that case)
197 * but needed for "individual applet" mode */ 197 * but needed for "individual applet" mode */
198 if (argv[1] && !argv[2] && strcmp(argv[1], "--help") == 0) { 198 if (argv[1]
199 && !argv[2]
200 && strcmp(argv[1], "--help") == 0
201 && strncmp(applet, "busybox", 7) != 0
202 ) {
199 /* Special case. POSIX says "test --help" 203 /* Special case. POSIX says "test --help"
200 * should be no different from e.g. "test --foo". */ 204 * should be no different from e.g. "test --foo". */
201 if (!ENABLE_TEST || strcmp(applet_name, "test") != 0) 205 if (!ENABLE_TEST || strcmp(applet_name, "test") != 0)
diff --git a/shell/hush.c b/shell/hush.c
index 831443e2e..31ca22a2e 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -117,6 +117,10 @@
117 * and therefore waitpid will return the same result as last time) 117 * and therefore waitpid will return the same result as last time)
118 */ 118 */
119#define ENABLE_HUSH_FAST 0 119#define ENABLE_HUSH_FAST 0
120/* TODO: implement simplified code for users which do not need ${var%...} ops
121 * So far ${var%...} ops are always enabled:
122 */
123#define ENABLE_HUSH_DOLLAR_OPS 1
120 124
121 125
122#if BUILD_AS_NOMMU 126#if BUILD_AS_NOMMU
@@ -2681,7 +2685,7 @@ static NOINLINE int expand_vars_to_list(o_string *output, int n, char *arg, char
2681 } 2685 }
2682 } 2686 }
2683 } else if (exp_op == ':') { 2687 } else if (exp_op == ':') {
2684#if ENABLE_HUSH_BASH_COMPAT 2688#if ENABLE_HUSH_BASH_COMPAT && ENABLE_SH_MATH_SUPPORT
2685 /* It's ${var:N[:M]} bashism. 2689 /* It's ${var:N[:M]} bashism.
2686 * Note that in encoded form it has TWO parts: 2690 * Note that in encoded form it has TWO parts:
2687 * var:N<SPECIAL_VAR_SYMBOL>M<SPECIAL_VAR_SYMBOL> 2691 * var:N<SPECIAL_VAR_SYMBOL>M<SPECIAL_VAR_SYMBOL>
@@ -5820,7 +5824,7 @@ static int parse_group(o_string *dest, struct parse_context *ctx,
5820 /* command remains "open", available for possible redirects */ 5824 /* command remains "open", available for possible redirects */
5821} 5825}
5822 5826
5823#if ENABLE_HUSH_TICK || ENABLE_SH_MATH_SUPPORT 5827#if ENABLE_HUSH_TICK || ENABLE_SH_MATH_SUPPORT || ENABLE_HUSH_DOLLAR_OPS
5824/* Subroutines for copying $(...) and `...` things */ 5828/* Subroutines for copying $(...) and `...` things */
5825static void add_till_backquote(o_string *dest, struct in_str *input); 5829static void add_till_backquote(o_string *dest, struct in_str *input);
5826/* '...' */ 5830/* '...' */
@@ -5921,9 +5925,9 @@ static int add_till_closing_bracket(o_string *dest, struct in_str *input, unsign
5921{ 5925{
5922 int ch; 5926 int ch;
5923 char dbl = end_ch & DOUBLE_CLOSE_CHAR_FLAG; 5927 char dbl = end_ch & DOUBLE_CLOSE_CHAR_FLAG;
5924#if ENABLE_HUSH_BASH_COMPAT 5928# if ENABLE_HUSH_BASH_COMPAT
5925 char end_char2 = end_ch >> 8; 5929 char end_char2 = end_ch >> 8;
5926#endif 5930# endif
5927 end_ch &= (DOUBLE_CLOSE_CHAR_FLAG - 1); 5931 end_ch &= (DOUBLE_CLOSE_CHAR_FLAG - 1);
5928 5932
5929 while (1) { 5933 while (1) {
@@ -5976,7 +5980,7 @@ static int add_till_closing_bracket(o_string *dest, struct in_str *input, unsign
5976 } 5980 }
5977 return ch; 5981 return ch;
5978} 5982}
5979#endif /* ENABLE_HUSH_TICK || ENABLE_SH_MATH_SUPPORT */ 5983#endif /* ENABLE_HUSH_TICK || ENABLE_SH_MATH_SUPPORT || ENABLE_HUSH_DOLLAR_OPS */
5980 5984
5981/* Return code: 0 for OK, 1 for syntax error */ 5985/* Return code: 0 for OK, 1 for syntax error */
5982#if BB_MMU 5986#if BB_MMU
@@ -6082,7 +6086,11 @@ static int parse_dollar(o_string *as_string,
6082 again: 6086 again:
6083 if (!BB_MMU) 6087 if (!BB_MMU)
6084 pos = dest->length; 6088 pos = dest->length;
6089#if ENABLE_HUSH_DOLLAR_OPS
6085 last_ch = add_till_closing_bracket(dest, input, end_ch); 6090 last_ch = add_till_closing_bracket(dest, input, end_ch);
6091#else
6092#error Simple code to only allow ${var} is not implemented
6093#endif
6086 if (as_string) { 6094 if (as_string) {
6087 o_addstr(as_string, dest->data + pos); 6095 o_addstr(as_string, dest->data + pos);
6088 o_addchr(as_string, last_ch); 6096 o_addchr(as_string, last_ch);
diff --git a/testsuite/ash.tests b/testsuite/ash.tests
index dd626e6d1..2eeb746e4 100755
--- a/testsuite/ash.tests
+++ b/testsuite/ash.tests
@@ -6,7 +6,6 @@
6# Licensed under GPL v2, see file LICENSE for details. 6# Licensed under GPL v2, see file LICENSE for details.
7 7
8. ./testing.sh 8. ./testing.sh
9
10test -f "$bindir/.config" && . "$bindir/.config" 9test -f "$bindir/.config" && . "$bindir/.config"
11 10
12test x"CONFIG_SCRIPT" = x"y" || exit 0 11test x"CONFIG_SCRIPT" = x"y" || exit 0
diff --git a/testsuite/cal.tests b/testsuite/cal.tests
index 30985688b..db693ee59 100755
--- a/testsuite/cal.tests
+++ b/testsuite/cal.tests
@@ -3,7 +3,6 @@
3# Licensed under GPL v2, see file LICENSE for details. 3# Licensed under GPL v2, see file LICENSE for details.
4 4
5. ./testing.sh 5. ./testing.sh
6
7test -f "$bindir/.config" && . "$bindir/.config" 6test -f "$bindir/.config" && . "$bindir/.config"
8 7
9# testing "test name" "command" "expected result" "file input" "stdin" 8# testing "test name" "command" "expected result" "file input" "stdin"
diff --git a/testsuite/cpio.tests b/testsuite/cpio.tests
index 5b397b01c..7aee774a1 100755
--- a/testsuite/cpio.tests
+++ b/testsuite/cpio.tests
@@ -99,7 +99,7 @@ SKIP=
99 99
100# chown on a link was affecting file, dropping its suid/sgid bits 100# chown on a link was affecting file, dropping its suid/sgid bits
101rm -rf cpio.testdir 101rm -rf cpio.testdir
102optional FEATURE_CPIO_O 102optional FEATURE_CPIO_O FEATURE_STAT_FORMAT
103mkdir cpio.testdir 103mkdir cpio.testdir
104touch cpio.testdir/file 104touch cpio.testdir/file
105chmod 6755 cpio.testdir/file # sets suid/sgid bits 105chmod 6755 cpio.testdir/file # sets suid/sgid bits
diff --git a/testsuite/date/date-works-1 b/testsuite/date/date-works-1
index 1b3e47ab0..e745d3841 100644
--- a/testsuite/date/date-works-1
+++ b/testsuite/date/date-works-1
@@ -1,3 +1,5 @@
1unset LANG
2
1dt=`busybox date -d 1:2 +%T` 3dt=`busybox date -d 1:2 +%T`
2test x"$dt" = x"01:02:00" 4test x"$dt" = x"01:02:00"
3 5
diff --git a/testsuite/expand.tests b/testsuite/expand.tests
index 357a9ad6b..2d92344d4 100755
--- a/testsuite/expand.tests
+++ b/testsuite/expand.tests
@@ -3,6 +3,7 @@
3# Licensed under GPL v2, see file LICENSE for details. 3# Licensed under GPL v2, see file LICENSE for details.
4 4
5. ./testing.sh 5. ./testing.sh
6test -f "$bindir/.config" && . "$bindir/.config"
6 7
7# testing "test name" "options" "expected result" "file input" "stdin" 8# testing "test name" "options" "expected result" "file input" "stdin"
8 9
@@ -12,13 +13,13 @@ testing "expand" \
12 "" \ 13 "" \
13 "\t12345678\t12345678\n" 14 "\t12345678\t12345678\n"
14 15
15optional UNICODE_SUPPORT 16test x"$CONFIG_UNICODE_SUPPORT" = x"y" \
17&& test x"$CONFIG_UNICODE_USING_LOCALE" != x"y" \
18&& test "$CONFIG_LAST_SUPPORTED_WCHAR" -gt "916" \
16testing "expand with unicode characher 0x394" \ 19testing "expand with unicode characher 0x394" \
17 "expand" \ 20 "expand" \
18 "Δ 12345ΔΔΔ 12345678\n" \ 21 "Δ 12345ΔΔΔ 12345678\n" \
19 "" \ 22 "" \
20 "Δ\t12345ΔΔΔ\t12345678\n" 23 "Δ\t12345ΔΔΔ\t12345678\n"
21SKIP=
22
23 24
24exit $FAILCOUNT 25exit $FAILCOUNT
diff --git a/testsuite/fold.tests b/testsuite/fold.tests
index 0197d024d..e5700cc2b 100755
--- a/testsuite/fold.tests
+++ b/testsuite/fold.tests
@@ -3,6 +3,7 @@
3# Licensed under GPL v2, see file LICENSE for details. 3# Licensed under GPL v2, see file LICENSE for details.
4 4
5. ./testing.sh 5. ./testing.sh
6test -f "$bindir/.config" && . "$bindir/.config"
6 7
7# testing "test name" "options" "expected result" "file input" "stdin" 8# testing "test name" "options" "expected result" "file input" "stdin"
8 9
@@ -28,9 +29,10 @@ be preserved
28is here:>\0< - they must be preserved 29is here:>\0< - they must be preserved
29" \ 30" \
30 31
31optional UNICODE_SUPPORT
32# The text was taken from English and Ukrainian wikipedia pages 32# The text was taken from English and Ukrainian wikipedia pages
33testing "fold -sw66 with unicode input" "fold -sw66" \ 33test x"$CONFIG_UNICODE_SUPPORT" = x"y" \
34&& test x"$CONFIG_UNICODE_USING_LOCALE" != x"y" \
35&& testing "fold -sw66 with unicode input" "fold -sw66" \
34 "\ 36 "\
35The Andromeda Galaxy (pronounced /ænˈdrɒmədə/, also known as \n\ 37The Andromeda Galaxy (pronounced /ænˈdrɒmədə/, also known as \n\
36Messier 31, M31, or NGC224; often referred to as the Great \n\ 38Messier 31, M31, or NGC224; often referred to as the Great \n\
@@ -56,6 +58,5 @@ Way.
56спіральна галактика, що знаходиться на відстані приблизно у 2,5 \ 58спіральна галактика, що знаходиться на відстані приблизно у 2,5 \
57мільйони світлових років від нашої планети у сузір'ї Андромеди. \ 59мільйони світлових років від нашої планети у сузір'ї Андромеди. \
58На початку ХХІ ст. в центрі галактики виявлено чорну дірку." 60На початку ХХІ ст. в центрі галактики виявлено чорну дірку."
59SKIP=
60 61
61exit $FAILCOUNT 62exit $FAILCOUNT
diff --git a/testsuite/ls.tests b/testsuite/ls.tests
index 0680762fc..dc842123d 100755
--- a/testsuite/ls.tests
+++ b/testsuite/ls.tests
@@ -3,10 +3,9 @@
3# Licensed under GPL v2, see file LICENSE for details. 3# Licensed under GPL v2, see file LICENSE for details.
4 4
5. ./testing.sh 5. ./testing.sh
6
7test -f "$bindir/.config" && . "$bindir/.config" 6test -f "$bindir/.config" && . "$bindir/.config"
8 7
9rm -rf ls.testdir >/dev/null 8rm -rf ls.testdir 2>/dev/null
10mkdir ls.testdir || exit 1 9mkdir ls.testdir || exit 1
11 10
12# testing "test name" "command" "expected result" "file input" "stdin" 11# testing "test name" "command" "expected result" "file input" "stdin"
@@ -15,9 +14,10 @@ mkdir ls.testdir || exit 1
15# I suspect we might fail to skip exactly correct number of bytes 14# I suspect we might fail to skip exactly correct number of bytes
16# over broked unicode sequences. 15# over broked unicode sequences.
17test x"$CONFIG_UNICODE_SUPPORT" = x"y" \ 16test x"$CONFIG_UNICODE_SUPPORT" = x"y" \
18&& test x"$CONFIG_LOCALE_SUPPORT" != x"y" \ 17&& test x"$CONFIG_UNICODE_USING_LOCALE" != x"y" \
19&& test x"$CONFIG_SUBST_WCHAR" = x"63" \ 18&& test x"$CONFIG_SUBST_WCHAR" = x"63" \
20&& test x"$CONFIG_LAST_SUPPORTED_WCHAR" = x"767" \ 19&& test x"$CONFIG_LAST_SUPPORTED_WCHAR" = x"767" \
20&& test x"$CONFIG_FEATURE_LS_SORTFILES" = x"y" \
21&& testing "ls unicode test with codepoints limited to 767" \ 21&& testing "ls unicode test with codepoints limited to 767" \
22"(cd ls.testdir && sh ../ls.mk_uni_tests) && ls -1 ls.testdir" \ 22"(cd ls.testdir && sh ../ls.mk_uni_tests) && ls -1 ls.testdir" \
23'0001_1__Some_correct_UTF-8_text___________________________________________| 23'0001_1__Some_correct_UTF-8_text___________________________________________|
@@ -134,7 +134,7 @@ test x"$CONFIG_UNICODE_SUPPORT" = x"y" \
134 134
135# Currently fails on "0080_4.2.2__U-000007FF_=_e0_9f_bf" line 135# Currently fails on "0080_4.2.2__U-000007FF_=_e0_9f_bf" line
136test x"$CONFIG_UNICODE_SUPPORT" = x"y" \ 136test x"$CONFIG_UNICODE_SUPPORT" = x"y" \
137&& test x"$CONFIG_LOCALE_SUPPORT" != x"y" \ 137&& test x"$CONFIG_UNICODE_USING_LOCALE" != x"y" \
138&& test x"$CONFIG_SUBST_WCHAR" = x"63" \ 138&& test x"$CONFIG_SUBST_WCHAR" = x"63" \
139&& test x"$CONFIG_LAST_SUPPORTED_WCHAR" = x"0" \ 139&& test x"$CONFIG_LAST_SUPPORTED_WCHAR" = x"0" \
140&& testing "ls unicode test with unlimited codepoints" \ 140&& testing "ls unicode test with unlimited codepoints" \
diff --git a/testsuite/mount.tests b/testsuite/mount.tests
index 3c7405fbd..ce1a6006b 100755
--- a/testsuite/mount.tests
+++ b/testsuite/mount.tests
@@ -3,7 +3,6 @@
3# Licensed under GPL v2, see file LICENSE for details. 3# Licensed under GPL v2, see file LICENSE for details.
4 4
5. ./testing.sh 5. ./testing.sh
6
7test -f "$bindir/.config" && . "$bindir/.config" 6test -f "$bindir/.config" && . "$bindir/.config"
8 7
9test "`id -u`" = 0 || { 8test "`id -u`" = 0 || {
diff --git a/testsuite/unexpand.tests b/testsuite/unexpand.tests
index a48e3214e..0727884f7 100755
--- a/testsuite/unexpand.tests
+++ b/testsuite/unexpand.tests
@@ -3,6 +3,7 @@
3# Licensed under GPL v2, see file LICENSE for details. 3# Licensed under GPL v2, see file LICENSE for details.
4 4
5. ./testing.sh 5. ./testing.sh
6test -f "$bindir/.config" && . "$bindir/.config"
6 7
7# testing "test name" "options" "expected result" "file input" "stdin" 8# testing "test name" "options" "expected result" "file input" "stdin"
8 9
@@ -30,9 +31,10 @@ testing "unexpand case 7" "unexpand" \
30testing "unexpand case 8" "unexpand" \ 31testing "unexpand case 8" "unexpand" \
31 "a b\n" "" "a b\n" \ 32 "a b\n" "" "a b\n" \
32 33
33optional UNICODE_SUPPORT 34test x"$CONFIG_UNICODE_SUPPORT" = x"y" \
35&& test x"$CONFIG_UNICODE_USING_LOCALE" != x"y" \
36&& test "$CONFIG_LAST_SUPPORTED_WCHAR" -gt "916" \
34testing "unexpand with unicode characher 0x394" "unexpand" \ 37testing "unexpand with unicode characher 0x394" "unexpand" \
35 "1ΔΔΔ5\t99999\n" "" "1ΔΔΔ5 99999\n" 38 "1ΔΔΔ5\t99999\n" "" "1ΔΔΔ5 99999\n"
36SKIP=
37 39
38exit $FAILCOUNT 40exit $FAILCOUNT