From a0eb4609b896a62f0cf9ebf15f4b6228bda4ed32 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Sun, 17 Jul 2011 23:09:53 +0000 Subject: [PATCH] LBIO: output LISTING_FOLLOWS; skip the . and .. directory entries. --- citadel/modules/bio/serv_bio.c | 5 +++++ 1 file changed, 5 insertions(+) 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'; -- 2.30.2