]> git.deb.at Git - pkg/abook.git/blob - debian/patches/01search_ctrl-d_segfault_fix
Imported Debian patch 0.5.6-5
[pkg/abook.git] / debian / patches / 01search_ctrl-d_segfault_fix
1 Index: abook-0.5.6/ui.c
2 ===================================================================
3 --- abook-0.5.6.orig/ui.c
4 +++ abook-0.5.6/ui.c
5 @@ -569,9 +569,13 @@ ui_find(int next)
6         } else {
7                 char *s;
8                 s = ui_readline("/", findstr, MAX_FIELD_LEN - 1, 0);
9 -               strncpy(findstr, s, MAX_FIELD_LEN);
10 -               free(s);
11                 refresh_screen();
12 +               if(s == NULL) {
13 +                       return; /* user cancelled (ctrl-G) */
14 +               } else {
15 +                       strncpy(findstr, s, MAX_FIELD_LEN);
16 +                       free(s);
17 +               }
18         }
19  
20         if( (item = find_item(findstr, curitem + !!next, search_fields)) < 0 &&