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:
parent
98e28ff3ed
commit
5bae8f00b8
1 changed files with 8 additions and 2 deletions
10
Src/glob.c
10
Src/glob.c
|
|
@ -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))) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue