]> diplodocus.org Git - nmh/blobdiff - sbr/fmt_new.c
print_sw.c: Move interface to own file.
[nmh] / sbr / fmt_new.c
index 9ee8956151113c60dc662c7d1069a0e715af3902..97e2a7ad3dbf6e90523c83f740a74b871de05a02 100644 (file)
@@ -1,14 +1,13 @@
-
-/*
- * fmt_new.c -- read format file/string and normalize
+/* fmt_new.c -- read format file/string and normalize
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
  * complete copyright information.
  */
 
-#include <h/mh.h>
-#include <h/utils.h>
+#include "h/mh.h"
+#include "error.h"
+#include "h/utils.h"
 
 #define QUOTE '\\'
 
@@ -28,10 +27,9 @@ char *
 new_fs (char *form, char *format, char *default_fs)
 {
     struct stat st;
-    register FILE *fp;
+    FILE *fp;
 
-    if (formats)
-       free (formats);
+    free(formats);
 
     if (form) {
        if ((fp = fopen (etcpath (form), "r")) == NULL)
@@ -59,7 +57,8 @@ new_fs (char *form, char *format, char *default_fs)
 
 
 void
-free_fs (){
+free_fs(void)
+{
     free (formats);
     formats = 0;
 }
@@ -103,7 +102,8 @@ normalize (char *cp)
                    break;
 
                case 0: 
-                   cp--;       /* fall */
+                   cp--;
+                   /* FALLTHRU */
                default: 
                    *dp++ = *cp;
                    break;