aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2001-05-02 17:52:49 +0000
committerMatt Kraai <kraai@debian.org>2001-05-02 17:52:49 +0000
commit20a3069ec0d1c242404e089cecfcc5bb7a88df0f (patch)
treefd57efa2b1398ccd505d5fbae2c2fd83798921e2
parent19ec9ee91e21bff2b1eb76a0633c79045eb0acee (diff)
downloadbusybox-w32-20a3069ec0d1c242404e089cecfcc5bb7a88df0f.tar.gz
busybox-w32-20a3069ec0d1c242404e089cecfcc5bb7a88df0f.tar.bz2
busybox-w32-20a3069ec0d1c242404e089cecfcc5bb7a88df0f.zip
Don't treat newline as pipe separator when processing substitutions.
-rw-r--r--hush.c5
-rw-r--r--shell/hush.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/hush.c b/hush.c
index c55d86f5d..01fd33486 100644
--- a/hush.c
+++ b/hush.c
@@ -2010,7 +2010,10 @@ int parse_stream(o_string *dest, struct p_context *ctx,
2010 } else { 2010 } else {
2011 if (m==2) { /* unquoted IFS */ 2011 if (m==2) { /* unquoted IFS */
2012 done_word(dest, ctx); 2012 done_word(dest, ctx);
2013 if (ch=='\n') done_pipe(ctx,PIPE_SEQ); 2013 /* If we aren't performing a substitution, treat a newline as a
2014 * command separator. */
2015 if (end_trigger != '\0' && ch=='\n')
2016 done_pipe(ctx,PIPE_SEQ);
2014 } 2017 }
2015 if (ch == end_trigger && !dest->quote && ctx->w==RES_NONE) { 2018 if (ch == end_trigger && !dest->quote && ctx->w==RES_NONE) {
2016 debug_printf("leaving parse_stream\n"); 2019 debug_printf("leaving parse_stream\n");
diff --git a/shell/hush.c b/shell/hush.c
index c55d86f5d..01fd33486 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -2010,7 +2010,10 @@ int parse_stream(o_string *dest, struct p_context *ctx,
2010 } else { 2010 } else {
2011 if (m==2) { /* unquoted IFS */ 2011 if (m==2) { /* unquoted IFS */
2012 done_word(dest, ctx); 2012 done_word(dest, ctx);
2013 if (ch=='\n') done_pipe(ctx,PIPE_SEQ); 2013 /* If we aren't performing a substitution, treat a newline as a
2014 * command separator. */
2015 if (end_trigger != '\0' && ch=='\n')
2016 done_pipe(ctx,PIPE_SEQ);
2014 } 2017 }
2015 if (ch == end_trigger && !dest->quote && ctx->w==RES_NONE) { 2018 if (ch == end_trigger && !dest->quote && ctx->w==RES_NONE) {
2016 debug_printf("leaving parse_stream\n"); 2019 debug_printf("leaving parse_stream\n");