summaryrefslogtreecommitdiff
blob: bacfd55a491d64c98af75ed38e8dfe63a8c0c5f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--- ui.c	10 Apr 2006 08:15:46 -0000	1.57
+++ ui.c	6 Sep 2006 02:24:33 -0000	1.58
@@ -569,9 +569,13 @@
 	} 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, curitem + !!next, search_fields)) < 0 &&