From 9dd0c2573b1e3a6f18356e4db6cee5e5329ecb67 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Fri, 8 Dec 2006 09:48:53 +0100 Subject: rename config "filename" to "dir" --- udev_utils.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'udev_utils.c') diff --git a/udev_utils.c b/udev_utils.c index b6e5275a16..e892012132 100644 --- a/udev_utils.c +++ b/udev_utils.c @@ -126,7 +126,6 @@ int add_matching_files(struct list_head *name_list, const char *dirname, const c { struct dirent *ent; DIR *dir; - char *ext; char filename[PATH_SIZE]; dbg("open directory '%s'", dirname); @@ -145,14 +144,16 @@ int add_matching_files(struct list_head *name_list, const char *dirname, const c continue; /* look for file matching with specified suffix */ - ext = strrchr(ent->d_name, '.'); - if (ext == NULL) - continue; - - if (strcmp(ext, suffix) != 0) - continue; - - dbg("put file '%s/%s' in list", dirname, ent->d_name); + if (suffix != NULL) { + const char *ext; + + ext = strrchr(ent->d_name, '.'); + if (ext == NULL) + continue; + if (strcmp(ext, suffix) != 0) + continue; + } + dbg("put file '%s/%s' into list", dirname, ent->d_name); snprintf(filename, sizeof(filename), "%s/%s", dirname, ent->d_name); filename[sizeof(filename)-1] = '\0'; -- cgit v1.2.3-54-g00ecf