LBIO: output LISTING_FOLLOWS; skip the . and .. directory entries.
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 17 Jul 2011 23:09:53 +0000 (23:09 +0000)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 4 Sep 2011 21:37:00 +0000 (21:37 +0000)
citadel/modules/bio/serv_bio.c

index e98131361f70598fd3c889dfc9c8051af62e0d3c..ac135cc2272c084baa4b6d2e2e42e53ac4227e14 100644 (file)
@@ -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';