aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-05-23 11:32:44 +0100
committerRon Yorston <rmy@pobox.com>2023-05-23 11:32:44 +0100
commit5adeafb91fe5d0fbfd2e4f773e64da9aa13d2f09 (patch)
tree5e739c2dd648786eeff06cc6a65fdff3d5ed8283 /shell
parentc2eb45989fcd59617884dc853743b5cc94b15935 (diff)
parent3e83699ce23400d75c7ddaa7ebfdec015177caa7 (diff)
downloadbusybox-w32-5adeafb91fe5d0fbfd2e4f773e64da9aa13d2f09.tar.gz
busybox-w32-5adeafb91fe5d0fbfd2e4f773e64da9aa13d2f09.tar.bz2
busybox-w32-5adeafb91fe5d0fbfd2e4f773e64da9aa13d2f09.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c2
-rw-r--r--shell/hush.c9
2 files changed, 11 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 87df555dd..09e8725bf 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -8096,6 +8096,8 @@ subevalvar(char *start, char *str, int strloc,
8096 char *restart_detect = stackblock(); 8096 char *restart_detect = stackblock();
8097 if (quotes && *loc == '\\') { 8097 if (quotes && *loc == '\\') {
8098 STPUTC(CTLESC, expdest); 8098 STPUTC(CTLESC, expdest);
8099 if (stackblock() != restart_detect)
8100 goto restart;
8099 len++; 8101 len++;
8100 } 8102 }
8101 STPUTC(*loc, expdest); 8103 STPUTC(*loc, expdest);
diff --git a/shell/hush.c b/shell/hush.c
index f8951d084..810dafd35 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -1429,6 +1429,7 @@ static void syntax_error_unterm_str(unsigned lineno UNUSED_PARAM, const char *s)
1429{ 1429{
1430 bb_error_msg("syntax error: unterminated %s", s); 1430 bb_error_msg("syntax error: unterminated %s", s);
1431//? source4.tests fails: in bash, echo ${^} in script does not terminate the script 1431//? source4.tests fails: in bash, echo ${^} in script does not terminate the script
1432// (but bash --posix, or if bash is run as "sh", does terminate in script, so maybe uncomment this?)
1432// die_if_script(); 1433// die_if_script();
1433} 1434}
1434 1435
@@ -7589,6 +7590,14 @@ static void parse_and_run_stream(struct in_str *inp, int end_trigger)
7589 } 7590 }
7590 /* Force prompt */ 7591 /* Force prompt */
7591 inp->p = NULL; 7592 inp->p = NULL;
7593 /* Clear "peeked" EOF. Without this,
7594 * $ { cmd }<Enter>
7595 * > ^D
7596 * hush: syntax error: unterminated {
7597 * exits interactive shell:
7598 */
7599 if (inp->peek_buf[0] == EOF)
7600 inp->peek_buf[0] = 0;
7592 /* This stream isn't empty */ 7601 /* This stream isn't empty */
7593 empty = 0; 7602 empty = 0;
7594 continue; 7603 continue;