aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--builtin.cpp2
-rw-r--r--tests/test1.in3
2 files changed, 3 insertions, 2 deletions
diff --git a/builtin.cpp b/builtin.cpp
index fa6ce1ee..e5e6f86f 100644
--- a/builtin.cpp
+++ b/builtin.cpp
@@ -1633,7 +1633,7 @@ static int builtin_echo( parser_t &parser, wchar_t **argv )
}
}
}
- if (print_newline)
+ if (print_newline && continue_output)
stdout_buffer.push_back('\n');
return STATUS_BUILTIN_OK;
}
diff --git a/tests/test1.in b/tests/test1.in
index a3ac131e..4dd01db1 100644
--- a/tests/test1.in
+++ b/tests/test1.in
@@ -83,7 +83,8 @@ echo -e 'abc\41def'
echo -e 'abc\041def'
echo -e 'abc\121def'
echo -e 'abc\1212def'
-echo -e 'abc\cdef'
+echo -e 'abc\cdef' # won't output a newline!
+echo ''
echo -e Catch your breath