* screen.c (do_search): Ignore the backspace key on empty

quick-search.

	From Egmont Koblinger <egmont * uhulinux hu>
This commit is contained in:
Roland Illig 2004-11-16 23:54:15 +00:00
parent 48690761d6
commit 1eab2f63b7
2 changed files with 11 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2004-11-17 Roland Illig <roland.illig@gmx.de>
* screen.c (do_search): Ignore the backspace key on empty
quick-search.
From Egmont Koblinger <egmont * uhulinux hu>
2004-11-15 Leonard den Ottolander <leonard * den ottolander nl> 2004-11-15 Leonard den Ottolander <leonard * den ottolander nl>
* file.c: Code cleanup (mostly indentation). * file.c: Code cleanup (mostly indentation).

View File

@ -1867,9 +1867,10 @@ do_search (WPanel *panel, int c_code)
int found; int found;
l = strlen (panel->search_buffer); l = strlen (panel->search_buffer);
if (l && (c_code == KEY_BACKSPACE)) if (c_code == KEY_BACKSPACE) {
panel->search_buffer[--l] = 0; if (l)
else { panel->search_buffer[--l] = '\0';
} else {
if (c_code && l < sizeof (panel->search_buffer)) { if (c_code && l < sizeof (panel->search_buffer)) {
panel->search_buffer[l] = c_code; panel->search_buffer[l] = c_code;
panel->search_buffer[l + 1] = 0; panel->search_buffer[l + 1] = 0;