nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 7f47d4228959b8f252ba3f400b6e4eacd125ed4f
parent d91ab6e9124c4d75c3c03bbadcb59311a4ec4624
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Mon,  8 Sep 2003 18:01:49 +0000

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

Diffstat:
MChangeLog | 3+++
Msrc/winio.c | 4++--
2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -90,6 +90,9 @@ CVS code - do_first_line() - Call edit_update() with TOP instead of CENTER; both do the 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() - Fix problem with the available space for a filename on the titlebar's being short by one. (DLR) diff --git a/src/winio.c b/src/winio.c @@ -537,7 +537,7 @@ int nanogetstr(int allowtabs, const char *buf, const char *def, fprintf(stderr, "Aha! \'%c\' (%d)\n", kbinput, kbinput); #endif - if (kbinput == t->val && kbinput < 32) { + if (kbinput == t->val && (kbinput < 32 || kbinput == 127)) { #ifndef DISABLE_HELP /* 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; } - if (kbinput < 32) + if (kbinput < 32 || kbinput == 127) break; answer = charealloc(answer, xend + 2); memmove(answer + x + 1, answer + x, xend - x + 1);