Skip to content
Snippets Groups Projects
Commit 99edf86b authored by rswindell's avatar rswindell
Browse files

GLOB_ONLYDIR is non-standard, not supported on FreeBSD, and when it is

supported, doesn't always work correctly (e.g. it's just a "hint").
parent b35a1e82
No related branches found
No related tags found
No related merge requests found
......@@ -313,13 +313,19 @@ long DLLCALL getdirsize(const char* path, BOOL include_subdirs, BOOL subdir_only
SAFECOPY(match,path);
backslash(match);
strcat(match,ALLFILES);
glob(match,subdir_only ? GLOB_ONLYDIR:GLOB_MARK,NULL,&g);
if(include_subdirs || subdir_only)
glob(match,GLOB_MARK,NULL,&g);
if(include_subdirs && !subdir_only)
count=g.gl_pathc;
else
for(gi=0;gi<g.gl_pathc;gi++)
if(*lastchar(g.gl_pathv[gi])!='/')
count++;
for(gi=0;gi<g.gl_pathc;gi++) {
if(*lastchar(g.gl_pathv[gi])=='/') {
if(!include_subdirs)
continue;
} else
if(subdir_only)
continue;
count++;
}
globfree(&g);
return(count);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment