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