]> diplodocus.org Git - nmh/blobdiff - sbr/crawl_folders.c
Don't `else' after goto. Simplify control flow.
[nmh] / sbr / crawl_folders.c
index 4889bf1c94d1c3b802169f4bc439965215e4fd95..ec025be55cdc59a9626eb32d951d7cae24ebf4b4 100644 (file)
@@ -2,8 +2,6 @@
 /*
  * crawl_folders.c -- crawl folder hierarchy
  *
- * $Id$
- *
  * 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.
@@ -31,7 +29,7 @@ struct crawl_context {
 static void
 add_folder (char *fold, struct crawl_context *crawl)
 {
-    register int i, j;
+    int i, j;
 
     /* if necessary, reallocate the space for folder names */
     if (crawl->foldp >= crawl->max) {
@@ -68,7 +66,7 @@ add_children (char *name, struct crawl_context *crawl)
     }
 
     if (strcmp (name, ".") == 0) {
-       prefix = getcpy ("");
+       prefix = mh_xstrdup("");
     } else {
        prefix = concat (name, "/", (void *)NULL);
     }
@@ -137,7 +135,8 @@ crawl_folders_body (struct crawl_context *crawl,
 void
 crawl_folders (char *dir, crawl_callback_t *callback, void *baton)
 {
-    struct crawl_context *crawl = mh_xmalloc (sizeof(*crawl));
+    struct crawl_context *crawl;
+    NEW(crawl);
     crawl->max = CRAWL_NUMFOLDERS;
     crawl->total = crawl->start = crawl->foldp = 0;
     crawl->folders = mh_xmalloc (crawl->max * sizeof(*crawl->folders));