Don't treat newline as pipe separator when processing substitutions.

This commit is contained in:
Matt Kraai 2001-05-02 17:52:49 +00:00
parent 19ec9ee91e
commit 20a3069ec0
2 changed files with 8 additions and 2 deletions

5
hush.c
View File

@ -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");

View File

@ -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");