From: Wilfried Goesgens Date: Sun, 17 Jul 2011 23:09:53 +0000 (+0000) Subject: LBIO: output LISTING_FOLLOWS; skip the . and .. directory entries. X-Git-Tag: v8.11~569 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=a0eb4609b896a62f0cf9ebf15f4b6228bda4ed32 LBIO: output LISTING_FOLLOWS; skip the . and .. directory entries. --- diff --git a/citadel/modules/bio/serv_bio.c b/citadel/modules/bio/serv_bio.c index e98131361..ac135cc22 100644 --- a/citadel/modules/bio/serv_bio.c +++ b/citadel/modules/bio/serv_bio.c @@ -111,6 +111,7 @@ void cmd_lbio(char *cmdbuf) return; } dont_resolve_uids = *cmdbuf == '1'; + cprintf("%d\n", LISTING_FOLLOWS); while ((readdir_r(filedir, d, &filedir_entry) == 0) && (filedir_entry != NULL)) { @@ -119,6 +120,10 @@ void cmd_lbio(char *cmdbuf) #else d_namelen = strlen(filedir_entry->d_name); #endif + if (((d_namelen == 1) && (filedir_entry->d_name[0] == '.')) || + ((d_namelen == 2) && (filedir_entry->d_name[0] == '.') && (filedir_entry->d_name[1] == '.'))) + continue; + if (dont_resolve_uids) { filedir_entry->d_name[d_namelen++] = '\n'; filedir_entry->d_name[d_namelen] = '\0';