diff --git a/edit-bestline.c b/edit-bestline.c index 8d6ad65..74c36a9 100644 --- a/edit-bestline.c +++ b/edit-bestline.c @@ -299,11 +299,10 @@ char *edit_alloc(void *cookie, size_t *count) { c->buffer = bestline(prompt); if (c->buffer) { *count = strlen(c->buffer); - if (*count) { + if (*count) bestlineHistoryAdd(c->buffer); - c->buffer[*count] = '\n'; - ++*count; - } + c->buffer[*count] = '\n'; + ++*count; /* include the \n */ } return c->buffer; }