summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2010-07-01 05:59:08 +0000
committerPaul Smith <psmith@gnu.org>2010-07-01 05:59:08 +0000
commit7746a1f74fa7696452a3c25953c7fb9a5feb5a6c (patch)
treeae8f49e2d9fdcf9ab99c9640890231c9e4c51ce5 /dir.c
parentc0239cdbfa81e40087cc1d93bcf292eee2a3fc68 (diff)
downloadgunmake-7746a1f74fa7696452a3c25953c7fb9a5feb5a6c.tar.gz
- Rename strieq() to patheq() for clarity.
- Convert xmalloc/memset pairs to xcalloc.
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/dir.c b/dir.c
index e127fc1..4224abb 100644
--- a/dir.c
+++ b/dir.c
@@ -721,7 +721,7 @@ dir_contents_file_exists_p (struct directory_contents *dir,
hash_insert_at (&dir->dirfiles, df, dirfile_slot);
}
/* Check if the name matches the one we're searching for. */
- if (filename != 0 && strieq (d->d_name, filename))
+ if (filename != 0 && patheq (d->d_name, filename))
return 1;
}
@@ -872,12 +872,9 @@ file_impossible (const char *filename)
}
if (dir->contents == 0)
- {
- /* The directory could not be stat'd. We allocate a contents
- structure for it, but leave it out of the contents hash table. */
- dir->contents = xmalloc (sizeof (struct directory_contents));
- memset (dir->contents, '\0', sizeof (struct directory_contents));
- }
+ /* The directory could not be stat'd. We allocate a contents
+ structure for it, but leave it out of the contents hash table. */
+ dir->contents = xcalloc (sizeof (struct directory_contents));
if (dir->contents->dirfiles.ht_vec == 0)
{