diff options
author | Paul Smith <psmith@gnu.org> | 2010-07-01 05:59:08 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2010-07-01 05:59:08 +0000 |
commit | 7746a1f74fa7696452a3c25953c7fb9a5feb5a6c (patch) | |
tree | ae8f49e2d9fdcf9ab99c9640890231c9e4c51ce5 /dir.c | |
parent | c0239cdbfa81e40087cc1d93bcf292eee2a3fc68 (diff) | |
download | gunmake-7746a1f74fa7696452a3c25953c7fb9a5feb5a6c.tar.gz |
- Rename strieq() to patheq() for clarity.
- Convert xmalloc/memset pairs to xcalloc.
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -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) { |