Make the \c special character in echo suppress the newline too

This commit is contained in:
ridiculousfish 2012-10-17 02:59:43 -07:00
parent 7ee0ce745e
commit 57de1388e8
2 changed files with 3 additions and 2 deletions

View file

@ -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'); stdout_buffer.push_back('\n');
return STATUS_BUILTIN_OK; return STATUS_BUILTIN_OK;
} }

View file

@ -83,7 +83,8 @@ echo -e 'abc\41def'
echo -e 'abc\041def' echo -e 'abc\041def'
echo -e 'abc\121def' echo -e 'abc\121def'
echo -e 'abc\1212def' echo -e 'abc\1212def'
echo -e 'abc\cdef' echo -e 'abc\cdef' # won't output a newline!
echo ''
echo -e Catch your breath echo -e Catch your breath