1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-29 17:31:02 +01:00

Minor optimization to qualnonemptydir() when a dir has a subdir.

This commit is contained in:
Wayne Davison 2004-04-06 17:45:47 +00:00
parent 98e28ff3ed
commit 5bae8f00b8

View file

@ -2807,10 +2807,16 @@ qualsheval(char *name, struct stat *buf, off_t days, char *str)
static int
qualnonemptydir(char *name, struct stat *buf, off_t days, char *str)
{
DIR *dirh = opendir(name);
DIR *dirh;
struct dirent *de;
if (dirh == NULL)
if (!S_ISDIR(buf->st_mode))
return 0;
if (buf->st_nlink > 2)
return 1;
if (!(dirh = opendir(name)))
return 0;
while ((de = readdir(dirh))) {