aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2020-05-29 10:49:00 +0100
committerRon Yorston <rmy@pobox.com>2020-05-29 11:03:33 +0100
commit53c09d0e1720bd927a2995f87df324a9854f1771 (patch)
tree982b357d9d188cfb6a1d488ebaba6c42d818209f
parentd4247a9f03290a96433e18dba538404005a21311 (diff)
parent45fa3f18adf57ef9d743038743d9c90573aeeb91 (diff)
downloadbusybox-w32-53c09d0e1720bd927a2995f87df324a9854f1771.tar.gz
busybox-w32-53c09d0e1720bd927a2995f87df324a9854f1771.tar.bz2
busybox-w32-53c09d0e1720bd927a2995f87df324a9854f1771.zip
Merge branch 'busybox' into mergeFRP-3466-g53c09d0e1
-rw-r--r--Makefile.flags3
-rwxr-xr-xapplets_sh/mim39
-rw-r--r--archival/unzip.c8
-rw-r--r--configs/mingw32_defconfig3
-rw-r--r--configs/mingw64_defconfig3
-rw-r--r--findutils/grep.c24
-rw-r--r--miscutils/mim.c15
-rw-r--r--networking/httpd.c6
-rw-r--r--networking/wget.c20
-rw-r--r--scripts/Kbuild.include1
-rw-r--r--scripts/Makefile.IMA1
-rw-r--r--scripts/Makefile.lib8
-rwxr-xr-xscripts/trylink3
-rw-r--r--shell/ash.c7
-rwxr-xr-xshell/ash_test/ash-misc/exitcode_trap2.tests3
-rwxr-xr-xshell/ash_test/ash-misc/exitcode_trap6.tests3
-rw-r--r--shell/hush.c3
-rwxr-xr-xshell/hush_test/hush-misc/exitcode_trap2.tests3
-rwxr-xr-xshell/hush_test/hush-misc/exitcode_trap6.tests3
-rwxr-xr-xtestsuite/grep.tests18
20 files changed, 138 insertions, 36 deletions
diff --git a/Makefile.flags b/Makefile.flags
index ec46c4f4f..dddeb0ce6 100644
--- a/Makefile.flags
+++ b/Makefile.flags
@@ -15,7 +15,8 @@ CPPFLAGS += \
15 -include include/autoconf.h \ 15 -include include/autoconf.h \
16 -D_GNU_SOURCE -DNDEBUG \ 16 -D_GNU_SOURCE -DNDEBUG \
17 $(if $(CONFIG_LFS),-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64) \ 17 $(if $(CONFIG_LFS),-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64) \
18 -D"BB_VER=KBUILD_STR($(BB_VER))" -D"MINGW_VER=KBUILD_STR($(MINGW_VER))" 18 -DMINGW_VER=$(squote)$(quote)$(MINGW_VER)$(quote)$(squote) \
19 -DBB_VER=$(squote)$(quote)$(BB_VER)$(quote)$(squote)
19 20
20CFLAGS += $(call cc-option,-Wall,) 21CFLAGS += $(call cc-option,-Wall,)
21CFLAGS += $(call cc-option,-Wshadow,) 22CFLAGS += $(call cc-option,-Wshadow,)
diff --git a/applets_sh/mim b/applets_sh/mim
new file mode 100755
index 000000000..2a65c35bb
--- /dev/null
+++ b/applets_sh/mim
@@ -0,0 +1,39 @@
1#!/bin/sh
2MIMFILE="Mimfile"
3if [ $# -ge 2 ] && [ "$1" = "-f" ]
4then
5 MIMFILE="$2"
6 shift 2
7fi
8exec <"$MIMFILE" || exit 1
9{
10 INCASE=false
11 while read -r REPLY
12 do
13 case $REPLY in
14 *:)
15 if ! $INCASE
16 then
17 printf '[ $# -eq 0 ] && set -- "%s"
18TARGET="$1"
19shift
20case "$TARGET" in
21' "${REPLY%:}"
22 else
23 printf ';;\n'
24 fi
25 printf '%s)\n' "${REPLY%:}"
26 INCASE=true
27 ;;
28 "") ;;
29 *) printf '%s\n' "${REPLY##[ ]}";;
30 esac
31 done
32 $INCASE && printf ';;\n'
33 printf '*)
34echo "Unknown command $TARGET"
35exit 1
36;;
37esac
38'
39} | sh -s "$@"
diff --git a/archival/unzip.c b/archival/unzip.c
index 759456c1d..67593d4ed 100644
--- a/archival/unzip.c
+++ b/archival/unzip.c
@@ -652,8 +652,14 @@ int unzip_main(int argc, char **argv)
652 } 652 }
653 653
654 /* Change dir if necessary */ 654 /* Change dir if necessary */
655 if (base_dir) 655 if (base_dir) {
656 /* -p DIR: try to create, errors don't matter.
657 * UnZip 6.00 does no multi-level mkdir (-p DIR1/DIR2 syntax),
658 * not using bb_make_directory() here (yet?)
659 */
660 mkdir(base_dir, 0777);
656 xchdir(base_dir); 661 xchdir(base_dir);
662 }
657 663
658 if (quiet <= 1) { /* not -qq */ 664 if (quiet <= 1) { /* not -qq */
659 if (quiet == 0) { 665 if (quiet == 0) {
diff --git a/configs/mingw32_defconfig b/configs/mingw32_defconfig
index afb52b4ee..bffe88842 100644
--- a/configs/mingw32_defconfig
+++ b/configs/mingw32_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Busybox version: 1.32.0.git 3# Busybox version: 1.32.0.git
4# Thu May 28 10:59:26 2020 4# Fri May 29 10:58:25 2020
5# 5#
6CONFIG_HAVE_DOT_CONFIG=y 6CONFIG_HAVE_DOT_CONFIG=y
7# CONFIG_PLATFORM_POSIX is not set 7# CONFIG_PLATFORM_POSIX is not set
@@ -820,6 +820,7 @@ CONFIG_FEATURE_LESS_ENV=y
820# CONFIG_FEATURE_MAKEDEVS_TABLE is not set 820# CONFIG_FEATURE_MAKEDEVS_TABLE is not set
821CONFIG_MAN=y 821CONFIG_MAN=y
822# CONFIG_MICROCOM is not set 822# CONFIG_MICROCOM is not set
823# CONFIG_MIM is not set
823# CONFIG_MT is not set 824# CONFIG_MT is not set
824# CONFIG_NANDWRITE is not set 825# CONFIG_NANDWRITE is not set
825# CONFIG_NANDDUMP is not set 826# CONFIG_NANDDUMP is not set
diff --git a/configs/mingw64_defconfig b/configs/mingw64_defconfig
index 938bbcc3a..d0a541162 100644
--- a/configs/mingw64_defconfig
+++ b/configs/mingw64_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Busybox version: 1.32.0.git 3# Busybox version: 1.32.0.git
4# Thu May 28 10:59:26 2020 4# Fri May 29 10:59:57 2020
5# 5#
6CONFIG_HAVE_DOT_CONFIG=y 6CONFIG_HAVE_DOT_CONFIG=y
7# CONFIG_PLATFORM_POSIX is not set 7# CONFIG_PLATFORM_POSIX is not set
@@ -820,6 +820,7 @@ CONFIG_FEATURE_LESS_ENV=y
820# CONFIG_FEATURE_MAKEDEVS_TABLE is not set 820# CONFIG_FEATURE_MAKEDEVS_TABLE is not set
821CONFIG_MAN=y 821CONFIG_MAN=y
822# CONFIG_MICROCOM is not set 822# CONFIG_MICROCOM is not set
823# CONFIG_MIM is not set
823# CONFIG_MT is not set 824# CONFIG_MT is not set
824# CONFIG_NANDWRITE is not set 825# CONFIG_NANDWRITE is not set
825# CONFIG_NANDDUMP is not set 826# CONFIG_NANDDUMP is not set
diff --git a/findutils/grep.c b/findutils/grep.c
index 5b8644c36..55e9c0a8f 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -650,6 +650,13 @@ static void load_regexes_from_file(llist_t *fopt)
650 } 650 }
651} 651}
652 652
653static void load_pattern_list(llist_t **lst, char *pattern)
654{
655 char *p;
656 while ((p = strsep(&pattern, "\n")) != NULL)
657 llist_add_to(lst, new_grep_list_data(p, 0));
658}
659
653static int FAST_FUNC file_action_grep(const char *filename, 660static int FAST_FUNC file_action_grep(const char *filename,
654 struct stat *statbuf, 661 struct stat *statbuf,
655 void* matched, 662 void* matched,
@@ -754,16 +761,19 @@ int grep_main(int argc UNUSED_PARAM, char **argv)
754#endif 761#endif
755 invert_search = ((option_mask32 & OPT_v) != 0); /* 0 | 1 */ 762 invert_search = ((option_mask32 & OPT_v) != 0); /* 0 | 1 */
756 763
757 { /* convert char **argv to grep_list_data_t */ 764 { /* convert char **argv to pattern_list */
758 llist_t *cur; 765 llist_t *cur, *new = NULL;
759 for (cur = pattern_head; cur; cur = cur->link) 766 for (cur = pattern_head; cur; cur = cur->link)
760 cur->data = new_grep_list_data(cur->data, 0); 767 load_pattern_list(&new, cur->data);
768 llist_free(pattern_head, NULL);
769 pattern_head = new;
761 } 770 }
762 if (option_mask32 & OPT_f) { 771 if (option_mask32 & OPT_f) {
763 load_regexes_from_file(fopt); 772 load_regexes_from_file(fopt);
764 if (!pattern_head) { /* -f EMPTY_FILE? */ 773 if (!pattern_head) { /* -f EMPTY_FILE? */
765 /* GNU grep treats it as "nothing matches" */ 774 /* GNU grep treats it as "nothing matches" except when -x */
766 llist_add_to(&pattern_head, new_grep_list_data((char*) "", 0)); 775 const char *data = (option_mask32 & OPT_x) ? ".*" : "";
776 llist_add_to(&pattern_head, new_grep_list_data((char*)data, 0));
767 invert_search ^= 1; 777 invert_search ^= 1;
768 } 778 }
769 } 779 }
@@ -805,11 +815,9 @@ int grep_main(int argc UNUSED_PARAM, char **argv)
805 /* if we didn't get a pattern from -e and no command file was specified, 815 /* if we didn't get a pattern from -e and no command file was specified,
806 * first parameter should be the pattern. no pattern, no worky */ 816 * first parameter should be the pattern. no pattern, no worky */
807 if (pattern_head == NULL) { 817 if (pattern_head == NULL) {
808 char *pattern;
809 if (*argv == NULL) 818 if (*argv == NULL)
810 bb_show_usage(); 819 bb_show_usage();
811 pattern = new_grep_list_data(*argv++, 0); 820 load_pattern_list(&pattern_head, *argv++);
812 llist_add_to(&pattern_head, pattern);
813 } 821 }
814 822
815 /* argv[0..(argc-1)] should be names of file to grep through. If 823 /* argv[0..(argc-1)] should be names of file to grep through. If
diff --git a/miscutils/mim.c b/miscutils/mim.c
new file mode 100644
index 000000000..d9b4694cb
--- /dev/null
+++ b/miscutils/mim.c
@@ -0,0 +1,15 @@
1//config:config MIM
2//config: bool "mim (0.5 kb)"
3//config: default y
4//config: depends on FEATURE_SH_EMBEDDED_SCRIPTS
5//config: help
6//config: Run a script from a Makefile-like specification file.
7//config: Unlike 'make' dependencies aren't supported.
8
9//applet:IF_MIM(APPLET_SCRIPTED(mim, scripted, BB_DIR_USR_SBIN, BB_SUID_DROP, mim))
10
11//usage:#define mim_trivial_usage
12//usage: "[-f FILE] [SHELL_OPTIONS] [TARGET] ..."
13//usage:#define mim_full_usage "\n\n"
14//usage: "Run a script from a Makefile-like specification file\n"
15//usage: "\n -f FILE Spec file (default Mimfile)"
diff --git a/networking/httpd.c b/networking/httpd.c
index efe57ecf7..eeaa4bec1 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -2878,10 +2878,16 @@ int httpd_main(int argc UNUSED_PARAM, char **argv)
2878 mingw_daemonize(argv); 2878 mingw_daemonize(argv);
2879#endif 2879#endif
2880 2880
2881 /* Chdir to home (unless we were re-execed for NOMMU case:
2882 * we are already in the home dir then).
2883 */
2881#if ENABLE_PLATFORM_MINGW32 2884#if ENABLE_PLATFORM_MINGW32
2882 if (!(opt & OPT_INETD)) 2885 if (!(opt & OPT_INETD))
2886#else
2887 if (!re_execed)
2883#endif 2888#endif
2884 xchdir(home_httpd); 2889 xchdir(home_httpd);
2890
2885 if (!(opt & OPT_INETD)) { 2891 if (!(opt & OPT_INETD)) {
2886#ifdef SIGCHLD 2892#ifdef SIGCHLD
2887 signal(SIGCHLD, SIG_IGN); 2893 signal(SIGCHLD, SIG_IGN);
diff --git a/networking/wget.c b/networking/wget.c
index 4365c76ce..bc237c4a8 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -91,6 +91,9 @@
91//config: patches, but do want to waste bandwidth expaining how wrong 91//config: patches, but do want to waste bandwidth expaining how wrong
92//config: it is, you will be ignored. 92//config: it is, you will be ignored.
93//config: 93//config:
94//config: FEATURE_WGET_OPENSSL does implement TLS verification
95//config: using the certificates available to OpenSSL.
96//config:
94//config:config FEATURE_WGET_OPENSSL 97//config:config FEATURE_WGET_OPENSSL
95//config: bool "Try to connect to HTTPS using openssl" 98//config: bool "Try to connect to HTTPS using openssl"
96//config: default y 99//config: default y
@@ -115,6 +118,9 @@
115//config: If openssl can't be executed, internal TLS code will be used 118//config: If openssl can't be executed, internal TLS code will be used
116//config: (if you enabled it); if openssl can be executed but fails later, 119//config: (if you enabled it); if openssl can be executed but fails later,
117//config: wget can't detect this, and download will fail. 120//config: wget can't detect this, and download will fail.
121//config:
122//config: By default TLS verification is performed, unless
123//config: --no-check-certificate option is passed.
118 124
119//applet:IF_WGET(APPLET(wget, BB_DIR_USR_BIN, BB_SUID_DROP)) 125//applet:IF_WGET(APPLET(wget, BB_DIR_USR_BIN, BB_SUID_DROP))
120 126
@@ -124,8 +130,11 @@
124//usage: IF_FEATURE_WGET_LONG_OPTIONS( 130//usage: IF_FEATURE_WGET_LONG_OPTIONS(
125//usage: "[-c|--continue] [--spider] [-q|--quiet] [-O|--output-document FILE]\n" 131//usage: "[-c|--continue] [--spider] [-q|--quiet] [-O|--output-document FILE]\n"
126//usage: " [-o|--output-file FILE] [--header 'header: value'] [-Y|--proxy on/off]\n" 132//usage: " [-o|--output-file FILE] [--header 'header: value'] [-Y|--proxy on/off]\n"
133//usage: IF_FEATURE_WGET_OPENSSL(
134//usage: " [--no-check-certificate]\n"
135//usage: )
127/* Since we ignore these opts, we don't show them in --help */ 136/* Since we ignore these opts, we don't show them in --help */
128/* //usage: " [--no-check-certificate] [--no-cache] [--passive-ftp] [-t TRIES]" */ 137/* //usage: " [--no-cache] [--passive-ftp] [-t TRIES]" */
129/* //usage: " [-nv] [-nc] [-nH] [-np]" */ 138/* //usage: " [-nv] [-nc] [-nH] [-np]" */
130//usage: " [-P DIR] [-S|--server-response] [-U|--user-agent AGENT]" IF_FEATURE_WGET_TIMEOUT(" [-T SEC]") " URL..." 139//usage: " [-P DIR] [-S|--server-response] [-U|--user-agent AGENT]" IF_FEATURE_WGET_TIMEOUT(" [-T SEC]") " URL..."
131//usage: ) 140//usage: )
@@ -137,7 +146,9 @@
137//usage: "Retrieve files via HTTP or FTP\n" 146//usage: "Retrieve files via HTTP or FTP\n"
138//usage: IF_FEATURE_WGET_LONG_OPTIONS( 147//usage: IF_FEATURE_WGET_LONG_OPTIONS(
139//usage: "\n --spider Only check URL existence: $? is 0 if exists" 148//usage: "\n --spider Only check URL existence: $? is 0 if exists"
140///////: "\n --no-check-certificate Don't validate the server's certificate" 149//usage: IF_FEATURE_WGET_OPENSSL(
150//usage: "\n --no-check-certificate Don't validate the server's certificate"
151//usage: )
141//usage: ) 152//usage: )
142//usage: "\n -c Continue retrieval of aborted transfer" 153//usage: "\n -c Continue retrieval of aborted transfer"
143//usage: "\n -q Quiet" 154//usage: "\n -q Quiet"
@@ -668,7 +679,7 @@ static int spawn_https_helper_openssl(const char *host, unsigned port)
668 pid = xvfork(); 679 pid = xvfork();
669 if (pid == 0) { 680 if (pid == 0) {
670 /* Child */ 681 /* Child */
671 char *argv[8]; 682 char *argv[9];
672 683
673 close(sp[0]); 684 close(sp[0]);
674 xmove_fd(sp[1], 0); 685 xmove_fd(sp[1], 0);
@@ -695,6 +706,9 @@ static int spawn_https_helper_openssl(const char *host, unsigned port)
695 argv[5] = (char*)"-servername"; 706 argv[5] = (char*)"-servername";
696 argv[6] = (char*)servername; 707 argv[6] = (char*)servername;
697 } 708 }
709 if (!(option_mask32 & WGET_OPT_NO_CHECK_CERT)) {
710 argv[7] = (char*)"-verify_return_error";
711 }
698 712
699 BB_EXECVP(argv[0], argv); 713 BB_EXECVP(argv[0], argv);
700 xmove_fd(3, 2); 714 xmove_fd(3, 2);
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 6ec1809a2..5b4db5c2c 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -4,6 +4,7 @@
4# Convinient variables 4# Convinient variables
5comma := , 5comma := ,
6squote := ' 6squote := '
7quote := "
7empty := 8empty :=
8space := $(empty) $(empty) 9space := $(empty) $(empty)
9 10
diff --git a/scripts/Makefile.IMA b/scripts/Makefile.IMA
index f155108d7..1e3005864 100644
--- a/scripts/Makefile.IMA
+++ b/scripts/Makefile.IMA
@@ -49,7 +49,6 @@ OBJCOPY = $(CROSS_COMPILE)objcopy
49OBJDUMP = $(CROSS_COMPILE)objdump 49OBJDUMP = $(CROSS_COMPILE)objdump
50 50
51CFLAGS := $(CFLAGS) 51CFLAGS := $(CFLAGS)
52CPPFLAGS += -D"KBUILD_STR(s)=\#s" #-Q
53 52
54# We need some generic definitions 53# We need some generic definitions
55include $(srctree)/scripts/Kbuild.include 54include $(srctree)/scripts/Kbuild.include
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 3e54ea712..d8d768a28 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -81,10 +81,10 @@ obj-dirs := $(addprefix $(obj)/,$(obj-dirs))
81# Note: It's possible that one object gets potentially linked into more 81# Note: It's possible that one object gets potentially linked into more
82# than one module. In that case KBUILD_MODNAME will be set to foo_bar, 82# than one module. In that case KBUILD_MODNAME will be set to foo_bar,
83# where foo and bar are the name of the modules. 83# where foo and bar are the name of the modules.
84name-fix = $(subst $(comma),_,$(subst -,_,$1)) 84name-fix = $(squote)$(quote)$(subst $(comma),_,$(subst -,_,$1))$(quote)$(squote)
85basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(*F)))" 85basename_flags = -DKBUILD_BASENAME=$(call name-fix,$(*F))
86modname_flags = $(if $(filter 1,$(words $(modname))),\ 86modname_flags = $(if $(filter 1,$(words $(modname))),\
87 -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") 87 -DKBUILD_MODNAME=$(call name-fix,$(modname)))
88 88
89_c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) 89_c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o)
90_a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) 90_a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o)
@@ -110,7 +110,7 @@ endif
110 110
111c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ 111c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \
112 $(__c_flags) $(modkern_cflags) \ 112 $(__c_flags) $(modkern_cflags) \
113 -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags) 113 $(basename_flags) $(modname_flags)
114 114
115a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ 115a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \
116 $(__a_flags) $(modkern_aflags) 116 $(__a_flags) $(modkern_aflags)
diff --git a/scripts/trylink b/scripts/trylink
index bb6b2de2f..6b74f092d 100755
--- a/scripts/trylink
+++ b/scripts/trylink
@@ -50,9 +50,6 @@ check_cc() {
50 echo "int main(int argc,char**argv){return argv?argc:0;}" >"$tempname".c 50 echo "int main(int argc,char**argv){return argv?argc:0;}" >"$tempname".c
51 # Can use "-o /dev/null", but older gcc tend to *unlink it* on failure! :( 51 # Can use "-o /dev/null", but older gcc tend to *unlink it* on failure! :(
52 # Was using "-xc /dev/null", but we need a valid C program. 52 # Was using "-xc /dev/null", but we need a valid C program.
53 # "eval" may be needed if CFLAGS can contain
54 # '... -D"BB_VER=KBUILD_STR(1.N.M)" ...'
55 # and we need shell to process quotes!
56 $CC $CFLAGS $LDFLAGS $1 "$tempname".c -o "$tempname" >/dev/null 2>&1 53 $CC $CFLAGS $LDFLAGS $1 "$tempname".c -o "$tempname" >/dev/null 2>&1
57 exitcode=$? 54 exitcode=$?
58 rm -f "$tempname" "$tempname".c "$tempname".o 55 rm -f "$tempname" "$tempname".c "$tempname".o
diff --git a/shell/ash.c b/shell/ash.c
index c6f64e202..27e097a99 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -9251,7 +9251,6 @@ typecmd(int argc UNUSED_PARAM, char **argv)
9251 return err; 9251 return err;
9252} 9252}
9253 9253
9254#if ENABLE_ASH_CMDCMD
9255static struct strlist * 9254static struct strlist *
9256fill_arglist(struct arglist *arglist, union node **argpp) 9255fill_arglist(struct arglist *arglist, union node **argpp)
9257{ 9256{
@@ -9268,6 +9267,7 @@ fill_arglist(struct arglist *arglist, union node **argpp)
9268 return *lastp; 9267 return *lastp;
9269} 9268}
9270 9269
9270#if ENABLE_ASH_CMDCMD
9271/* Is it "command [-p] PROG ARGS" bltin, no other opts? Return ptr to "PROG" if yes */ 9271/* Is it "command [-p] PROG ARGS" bltin, no other opts? Return ptr to "PROG" if yes */
9272static int 9272static int
9273parse_command_args(struct arglist *arglist, union node **argpp, const char **path) 9273parse_command_args(struct arglist *arglist, union node **argpp, const char **path)
@@ -10882,11 +10882,13 @@ evalcommand(union node *cmd, int flags)
10882 vlocal = !spclbltin; 10882 vlocal = !spclbltin;
10883 } 10883 }
10884 cmd_is_exec = cmdentry.u.cmd == EXECCMD; 10884 cmd_is_exec = cmdentry.u.cmd == EXECCMD;
10885#if ENABLE_ASH_CMDCMD
10885 if (cmdentry.u.cmd != COMMANDCMD) 10886 if (cmdentry.u.cmd != COMMANDCMD)
10886 break; 10887 break;
10887 10888
10888 cmd_flag = parse_command_args(&arglist, &argp, &path); 10889 cmd_flag = parse_command_args(&arglist, &argp, &path);
10889 if (!cmd_flag) 10890 if (!cmd_flag)
10891#endif
10890 break; 10892 break;
10891 } 10893 }
10892 10894
@@ -14574,8 +14576,7 @@ helpcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
14574static int FAST_FUNC 14576static int FAST_FUNC
14575historycmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) 14577historycmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
14576{ 14578{
14577 if (line_input_state) 14579 show_history(line_input_state);
14578 show_history(line_input_state);
14579 return EXIT_SUCCESS; 14580 return EXIT_SUCCESS;
14580} 14581}
14581#endif 14582#endif
diff --git a/shell/ash_test/ash-misc/exitcode_trap2.tests b/shell/ash_test/ash-misc/exitcode_trap2.tests
index f259774bf..aff6d5187 100755
--- a/shell/ash_test/ash-misc/exitcode_trap2.tests
+++ b/shell/ash_test/ash-misc/exitcode_trap2.tests
@@ -3,7 +3,6 @@
3$THIS_SH -c ' 3$THIS_SH -c '
4 trap "false;exit" term 4 trap "false;exit" term
5 kill $$ & 5 kill $$ &
6 (exit 42) 6 (sleep 1; exit 42)
7 wait
8' 7'
9echo 42:$? 8echo 42:$?
diff --git a/shell/ash_test/ash-misc/exitcode_trap6.tests b/shell/ash_test/ash-misc/exitcode_trap6.tests
index 15fb99d2d..59a07fc91 100755
--- a/shell/ash_test/ash-misc/exitcode_trap6.tests
+++ b/shell/ash_test/ash-misc/exitcode_trap6.tests
@@ -5,7 +5,6 @@ $THIS_SH -c '
5 trap "echo INT" int 5 trap "echo INT" int
6 trap "kill -int $$;exit" term 6 trap "kill -int $$;exit" term
7 kill $$ & 7 kill $$ &
8 (exit 42) 8 (sleep 1; exit 42)
9 wait
10' 9'
11echo 42:$? 10echo 42:$?
diff --git a/shell/hush.c b/shell/hush.c
index 0a92f5da7..cab7ea5b0 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -10461,8 +10461,7 @@ static int FAST_FUNC builtin_help(char **argv UNUSED_PARAM)
10461#if MAX_HISTORY && ENABLE_FEATURE_EDITING 10461#if MAX_HISTORY && ENABLE_FEATURE_EDITING
10462static int FAST_FUNC builtin_history(char **argv UNUSED_PARAM) 10462static int FAST_FUNC builtin_history(char **argv UNUSED_PARAM)
10463{ 10463{
10464 if (G.line_input_state) 10464 show_history(G.line_input_state);
10465 show_history(G.line_input_state);
10466 return EXIT_SUCCESS; 10465 return EXIT_SUCCESS;
10467} 10466}
10468#endif 10467#endif
diff --git a/shell/hush_test/hush-misc/exitcode_trap2.tests b/shell/hush_test/hush-misc/exitcode_trap2.tests
index f259774bf..aff6d5187 100755
--- a/shell/hush_test/hush-misc/exitcode_trap2.tests
+++ b/shell/hush_test/hush-misc/exitcode_trap2.tests
@@ -3,7 +3,6 @@
3$THIS_SH -c ' 3$THIS_SH -c '
4 trap "false;exit" term 4 trap "false;exit" term
5 kill $$ & 5 kill $$ &
6 (exit 42) 6 (sleep 1; exit 42)
7 wait
8' 7'
9echo 42:$? 8echo 42:$?
diff --git a/shell/hush_test/hush-misc/exitcode_trap6.tests b/shell/hush_test/hush-misc/exitcode_trap6.tests
index 15fb99d2d..59a07fc91 100755
--- a/shell/hush_test/hush-misc/exitcode_trap6.tests
+++ b/shell/hush_test/hush-misc/exitcode_trap6.tests
@@ -5,7 +5,6 @@ $THIS_SH -c '
5 trap "echo INT" int 5 trap "echo INT" int
6 trap "kill -int $$;exit" term 6 trap "kill -int $$;exit" term
7 kill $$ & 7 kill $$ &
8 (exit 42) 8 (sleep 1; exit 42)
9 wait
10' 9'
11echo 42:$? 10echo 42:$?
diff --git a/testsuite/grep.tests b/testsuite/grep.tests
index 26f8e69cf..e38278810 100755
--- a/testsuite/grep.tests
+++ b/testsuite/grep.tests
@@ -129,6 +129,12 @@ testing "grep -v -f EMPTY_FILE" \
129 "" \ 129 "" \
130 "test\n" 130 "test\n"
131 131
132testing "grep -vxf EMPTY_FILE" \
133 "grep -vxf input" \
134 "test\n" \
135 "" \
136 "test\n"
137
132testing "grep -Fw matches only words" \ 138testing "grep -Fw matches only words" \
133 "grep -Fw foo input" \ 139 "grep -Fw foo input" \
134 "" \ 140 "" \
@@ -184,6 +190,18 @@ testing "grep -x -v -e EXP1 -e EXP2 finds nothing if either EXP matches" \
184 "" \ 190 "" \
185 " aa bb cc\n" 191 " aa bb cc\n"
186 192
193testing "grep PATTERN can be a newline-delimited list" \
194 'grep -Fv "$(printf "foo\nbar\n")"' \
195 "baz\n" \
196 "" \
197 "foo\nbar\nbaz\n"
198
199testing "grep -e PATTERN can be a newline-delimited list" \
200 'grep -Fv -e "$(printf "foo\nbar\n")"' \
201 "baz\n" \
202 "" \
203 "foo\nbar\nbaz\n"
204
187# -r on symlink to dir should recurse into dir 205# -r on symlink to dir should recurse into dir
188mkdir -p grep.testdir/foo 206mkdir -p grep.testdir/foo
189echo bar > grep.testdir/foo/file 207echo bar > grep.testdir/foo/file