]> diplodocus.org Git - nmh/blobdiff - sbr/makedir.c
get_file_info(): Flip logic throughout, reducing nesting.
[nmh] / sbr / makedir.c
index a905f331cde5b2ba32ebaa919d84a529562c2de7..9d5e12e537601cb17ca39334450f2974385f7100 100644 (file)
@@ -1,6 +1,4 @@
-
-/*
- * makedir.c -- make a directory
+/* makedir.c -- make a directory
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -12,6 +10,7 @@
  */
 
 #include <h/mh.h>
+#include "makedir.h"
 #include <sys/file.h>
 
 int
@@ -45,7 +44,7 @@ makedir (const char *dir)
     c = strncpy(path, dir, sizeof(path));
 
     while (!had_an_error && (c = strchr((c + 1), '/')) != NULL) {
-        *c = (char)0;
+        *c = '\0';
         if (access(path, X_OK)) {
             if (errno != ENOENT){
                 advise (dir, "unable to create directory");
@@ -73,6 +72,5 @@ makedir (const char *dir)
 
     if (had_an_error)
         return 0;  /* opposite of UNIX error return convention */
-    else
-        return 1;
+    return 1;
 }