--- cups/dir.c 2006/09/03 08:53:52 1.1 +++ cups/dir.c 2006/09/03 08:57:17 @@ -381,22 +381,24 @@ cupsDirRead(cups_dir_t *dp) /* I - Dire } DEBUG_printf((" readdir_r() returned \"%s\"...\n", entry->d_name)); - } - while (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, "..")); - /* - * Copy the name over and get the file information... - */ + if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, "..")) + continue; - strlcpy(dp->entry.filename, entry->d_name, sizeof(dp->entry.filename)); - - snprintf(filename, sizeof(filename), "%s/%s", dp->directory, entry->d_name); - if (stat(filename, &(dp->entry.fileinfo))) - { - DEBUG_printf((" stat() failed for \"%s\" - %s...\n", filename, - strerror(errno))); - return (NULL); - } + /* + * Copy the name over and get the file information... + */ + + strlcpy(dp->entry.filename, entry->d_name, sizeof(dp->entry.filename)); + + snprintf(filename, sizeof(filename), "%s/%s", dp->directory, entry->d_name); + if (stat(filename, &(dp->entry.fileinfo))) + { + DEBUG_printf((" stat() failed for \"%s\" - %s...\n", filename, + strerror(errno))); + continue; + } + } while (0); /* * Return the entry...