From 7746a1f74fa7696452a3c25953c7fb9a5feb5a6c Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Thu, 1 Jul 2010 05:59:08 +0000 Subject: - Rename strieq() to patheq() for clarity. - Convert xmalloc/memset pairs to xcalloc. --- dir.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'dir.c') 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) { -- cgit v1.2.3