From 9354e9c641980028ac5733e04e6ea17b5395ab8f Mon Sep 17 00:00:00 2001 From: Cedric Duval Date: Wed, 6 Sep 2006 02:24:33 +0000 Subject: [PATCH] Handle user aborting search (fixes Debian bug #386217). --- ui.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui.c b/ui.c index 0bfe4e3..1d5eb43 100644 --- a/ui.c +++ b/ui.c @@ -567,9 +567,13 @@ ui_find(int next) } else { char *s; s = ui_readline("/", findstr, MAX_FIELD_LEN - 1, 0); - strncpy(findstr, s, MAX_FIELD_LEN); - free(s); refresh_screen(); + if(s == NULL) { + return; /* user cancelled (ctrl-G) */ + } else { + strncpy(findstr, s, MAX_FIELD_LEN); + free(s); + } } if( (item = find_item(findstr, list_get_curitem() + !!next, -- 2.39.2