edit: Treat blank interactive input like empty input

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2013-01-20 23:38:40 +01:00
parent 4c1866285b
commit 33456b3371
3 changed files with 23 additions and 3 deletions

View file

@ -405,11 +405,9 @@ getin(char *buf, char **valp)
p = getstarg(NULL, "%c xxxxx -- thing value : ", buf);
if (!p)
return -1;
if (!*p)
return 0;
for (; isspace(*p); p++) ;
if (!*p)
return -1;
return 0;
thing = *p;
for (; *p && !isspace(*p); p++) ;
for (; isspace(*p); p++) ;