Skip to content

Commit ababd06

Browse files
committed
Merge pull request #2402 from dscho/add-i-in-c-status-and-help-gfw
built-in add -i/-p: update to latest iteration
2 parents e80cb79 + d922a37 commit ababd06

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

add-interactive.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,8 @@ static ssize_t list_and_choose(struct add_i_state *s,
351351
}
352352
}
353353

354-
p[sep] = '\0';
354+
if (p[sep])
355+
p[sep++] = '\0';
355356
if (from < 0) {
356357
from = find_unique(p, items);
357358
if (from >= 0)
@@ -377,7 +378,7 @@ static ssize_t list_and_choose(struct add_i_state *s,
377378
res += choose ? +1 : -1;
378379
}
379380

380-
p += sep + 1;
381+
p += sep;
381382
}
382383

383384
if ((immediate && res != LIST_AND_CHOOSE_ERROR) ||

0 commit comments

Comments
 (0)