X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Fcrawl_folders.c;h=2691a78114e01db140a353463eb770ef37a5f9f0;hp=28116b7ed24f699adf4bcff7c434ae5ca1539eae;hb=ced6090a330d3d83d0bce709f756aa3d7d65fea4;hpb=337338b404931f06f0db2119c9e145e8ca5a9860 diff --git a/sbr/crawl_folders.c b/sbr/crawl_folders.c index 28116b7..2691a78 100644 --- a/sbr/crawl_folders.c +++ b/sbr/crawl_folders.c @@ -1,18 +1,20 @@ /* - * crawl_folders.c -- crawl folder hierarchy - * - * This code is Copyright (c) 2008, by the authors of nmh. See the - * COPYRIGHT file in the root directory of the nmh distribution for - * complete copyright information. - */ +** crawl_folders.c -- crawl folder hierarchy +** +** This code is Copyright (c) 2008, by the authors of nmh. See the +** COPYRIGHT file in the root directory of the nmh distribution for +** complete copyright information. +*/ #include #include #include struct crawl_context { - int max; /* how many folders we currently can hold in the array - * `folders', increased by CRAWL_NUMFOLDERS at a time */ + int max; /* + ** how many folders we currently can hold in the array + ** `folders', increased by CRAWL_NUMFOLDERS at a time + */ int total; /* how many `folders' actually has */ char **folders; /* the array of folders */ int start; @@ -20,9 +22,9 @@ struct crawl_context { }; /* - * Add the folder name into the - * list in a sorted fashion. - */ +** Add the folder name into the +** list in a sorted fashion. +*/ static void add_folder (char *fold, struct crawl_context *crawl) @@ -70,8 +72,10 @@ add_children (char *name, struct crawl_context *crawl) } while ((dp = readdir (dd))) { - /* If the system supports it, try to skip processing of - * children we know are not directories or symlinks. */ + /* + ** If the system supports it, try to skip processing of + ** children we know are not directories or symlinks. + */ child_is_folder = -1; #if defined(HAVE_STRUCT_DIRENT_D_TYPE) if (dp->d_type == DT_DIR) { @@ -84,8 +88,10 @@ add_children (char *name, struct crawl_context *crawl) continue; } child = concat (prefix, dp->d_name, (void *)NULL); - /* If we have no d_type or d_type is DT_LNK or DT_UNKNOWN, stat the - * child to see what it is. */ + /* + ** If we have no d_type or d_type is DT_LNK or DT_UNKNOWN, + ** stat the child to see what it is. + */ if (child_is_folder == -1) { child_is_folder = (stat (child, &st) != -1 && S_ISDIR(st.st_mode)); } @@ -140,8 +146,10 @@ crawl_folders (char *dir, crawl_callback_t *callback, void *baton) crawl_folders_body (crawl, dir, callback, baton); - /* Note that we "leak" the folder names, on the assumption that the caller - * is using them. */ + /* + ** Note that we "leak" the folder names, on the assumption that the + ** caller is using them. + */ free (crawl->folders); free (crawl); }