From 20a3069ec0d1c242404e089cecfcc5bb7a88df0f Mon Sep 17 00:00:00 2001 From: Matt Kraai Date: Wed, 2 May 2001 17:52:49 +0000 Subject: [PATCH] Don't treat newline as pipe separator when processing substitutions. --- hush.c | 5 ++++- shell/hush.c | 5 ++++- 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, } else { if (m==2) { /* unquoted IFS */ done_word(dest, ctx); - if (ch=='\n') done_pipe(ctx,PIPE_SEQ); + /* If we aren't performing a substitution, treat a newline as a + * command separator. */ + if (end_trigger != '\0' && ch=='\n') + done_pipe(ctx,PIPE_SEQ); } if (ch == end_trigger && !dest->quote && ctx->w==RES_NONE) { 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, } else { if (m==2) { /* unquoted IFS */ done_word(dest, ctx); - if (ch=='\n') done_pipe(ctx,PIPE_SEQ); + /* If we aren't performing a substitution, treat a newline as a + * command separator. */ + if (end_trigger != '\0' && ch=='\n') + done_pipe(ctx,PIPE_SEQ); } if (ch == end_trigger && !dest->quote && ctx->w==RES_NONE) { debug_printf("leaving parse_stream\n"); -- 2.25.1