From: Cedric Duval Date: Wed, 6 Sep 2006 02:24:33 +0000 (+0000) Subject: Handle user aborting search (fixes Debian bug #386217). X-Git-Tag: upstream/0.6.1~2^2~87 X-Git-Url: https://git.deb.at/w?p=pkg%2Fabook.git;a=commitdiff_plain;h=9354e9c641980028ac5733e04e6ea17b5395ab8f Handle user aborting search (fixes Debian bug #386217). --- 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,