Implementing virtually empty directories for "dont descend" looks
easier to me this way. It should also be an optimization, because now
we don't walk the whole directory anymore after . and .., which always
come first anyway.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
return true;
}
+ if (dont_descend && (dptr_FileNumber(dirptr) >= 2)) {
+ /*
+ * . and .. were returned first, we're done showing
+ * the directory as empty.
+ */
+ return false;
+ }
+
pathlen = strlen(dpath);
slashlen = ( dpath[pathlen-1] != '/') ? 1 : 0;
while (true) {
char *dname = NULL;
- bool isdots;
char *fname = NULL;
char *pathreal = NULL;
struct smb_filename *atname = NULL;
return false;
}
- isdots = (ISDOT(dname) || ISDOTDOT(dname));
- if (dont_descend && !isdots) {
- TALLOC_FREE(dname);
- continue;
- }
-
if (IS_VETO_PATH(conn, dname)) {
TALLOC_FREE(dname);
continue;