Switch the prompt code to return an empty string when the user enters no

response and reserve NULL for an explicit cancel. Change all callbacks to treat
them the same so no functional change.

Also add cancel key bindings to emacs mode which were missing.
This commit is contained in:
Nicholas Marriott
2009-08-13 23:44:18 +00:00
parent 7a359c00ac
commit 09cbd0c695
5 changed files with 11 additions and 10 deletions

View File

@ -66,7 +66,7 @@ cmd_select_prompt_callback(void *data, const char *s)
char msg[128];
u_int idx;
if (s == NULL)
if (s == NULL || *s == '\0')
return (0);
idx = strtonum(s, 0, UINT_MAX, &errstr);