X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=ui.c;h=6fe2f0f47079ff9692441b62356cff8e416683ef;hb=242907dcb6220a23b620f3314e96581b5b472a0d;hp=b7c486a1cd57fb86dcb0eabadde8f511505541a4;hpb=7751b3edc145646e6b55e2fda82eb5619fbe0074;p=pkg%2Fabook.git diff --git a/ui.c b/ui.c index b7c486a..6fe2f0f 100644 --- a/ui.c +++ b/ui.c @@ -1,6 +1,6 @@ /* - * $Id: ui.c,v 1.57 2006/04/10 08:15:46 jheinonen Exp $ + * $Id: ui.c,v 1.58 2006/09/06 02:24:33 cduval Exp $ * * by JH * @@ -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,