* find.c (find_file): Skip entries without data when panelizing.

Found by Valgrind.
This commit is contained in:
Pavel Roskin 2002-12-11 07:14:00 +00:00
parent 036689bf51
commit 42fcf6c927
2 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,8 @@
2002-12-11 Pavel Roskin <proski@gnu.org>
* find.c (find_file): Skip entries without data when panelizing.
Found by Valgrind.
* eregex.h: Undefine __restrict_arr before redefining to avoid a
warning if it's defined.

View File

@ -64,7 +64,7 @@ enum {
B_VIEW
};
/* A list of directories to be ignores, separated with ':' */
/* List of directories to be ignored, separated by ':' */
char *find_ignore_dirs = 0;
static WInput *in_start; /* Start path */
@ -884,13 +884,14 @@ find_file (char *start_dir, char *pattern, char *content, char **dirname, char
for (i = 0; entry && i < find_list->count; entry = entry->next, i++){
char *filename;
if (!entry->text || !entry->data)
continue;
if (content_pattern)
filename = strchr (entry->text+4, ':')+1;
else
filename = entry->text+4;
if (!entry->text || !entry->data)
continue;
dir = entry->data;
if (dir [0] == '.' && dir [1] == 0)
name = g_strdup (filename);