Fix #351: reduce prompt length for new file/dir

This commit is contained in:
Arun Prakash Jana 2019-10-11 18:38:06 +05:30
parent b42efcbb1f
commit a7d224f1e5
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 7 additions and 2 deletions

View File

@ -4323,7 +4323,13 @@ nochange:
#endif
break;
case SEL_NEW:
tmp = xreadline(NULL, "name/link suffix [@ for none]: ");
r = get_input("create 'f'(ile) / 'd'(ir) / 's'(ym) / 'h'(ard)?");
if (r == 'f' || r == 'd') {
tmp = xreadline(NULL, "name: ");
} else if (r == 's' || r == 'h') {
tmp = xreadline(NULL, "link suffix [@ for none]: ");
} else
tmp = NULL;
break;
default: /* SEL_RENAME */
tmp = xreadline(dents[cur].name, "");
@ -4424,7 +4430,6 @@ nochange:
}
} else {
/* Check if it's a dir or file */
r = get_input("create 'f'(ile) / 'd'(ir) / 's'(ym) / 'h'(ard)?");
if (r == 'f') {
r = openat(fd, tmp, O_CREAT, 0666);
close(r);