aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/lineedit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index 678c4d29c..d5e92e84c 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -430,7 +430,8 @@ static void put_till_end_and_adv_cursor(void)
430static void goto_new_line(void) 430static void goto_new_line(void)
431{ 431{
432 put_till_end_and_adv_cursor(); 432 put_till_end_and_adv_cursor();
433 if (cmdedit_x != 0) 433 /* "cursor == 0" is only if prompt is "" and user input is empty */
434 if (cursor == 0 || cmdedit_x != 0)
434 bb_putchar('\n'); 435 bb_putchar('\n');
435} 436}
436 437