don't let the user type in ASCII 127 at the statusbar prompt

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1547 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2003-09-08 18:01:49 +00:00
parent d91ab6e912
commit 7f47d42289
2 changed files with 5 additions and 2 deletions

View File

@ -90,6 +90,9 @@ CVS code -
do_first_line() do_first_line()
- Call edit_update() with TOP instead of CENTER; both do the - Call edit_update() with TOP instead of CENTER; both do the
same thing, but it works faster with TOP. (DLR) same thing, but it works faster with TOP. (DLR)
nanogetstr()
- Don't let the user type in ASCII 127 at the statusbar prompt.
(DLR)
titlebar() titlebar()
- Fix problem with the available space for a filename on the - Fix problem with the available space for a filename on the
titlebar's being short by one. (DLR) titlebar's being short by one. (DLR)

View File

@ -537,7 +537,7 @@ int nanogetstr(int allowtabs, const char *buf, const char *def,
fprintf(stderr, "Aha! \'%c\' (%d)\n", kbinput, kbinput); fprintf(stderr, "Aha! \'%c\' (%d)\n", kbinput, kbinput);
#endif #endif
if (kbinput == t->val && kbinput < 32) { if (kbinput == t->val && (kbinput < 32 || kbinput == 127)) {
#ifndef DISABLE_HELP #ifndef DISABLE_HELP
/* Have to do this here, it would be too late to do it /* Have to do this here, it would be too late to do it
@ -727,7 +727,7 @@ int nanogetstr(int allowtabs, const char *buf, const char *def,
return t->val; return t->val;
} }
if (kbinput < 32) if (kbinput < 32 || kbinput == 127)
break; break;
answer = charealloc(answer, xend + 2); answer = charealloc(answer, xend + 2);
memmove(answer + x + 1, answer + x, xend - x + 1); memmove(answer + x + 1, answer + x, xend - x + 1);