]> diplodocus.org Git - nmh/blobdiff - sbr/fmt_new.c
new.c: Order two return statements to match comment.
[nmh] / sbr / fmt_new.c
index c1bc7c730e83edfccf4462ba2094ea50d3af89fb..cd81017a4a4c12c79f336546e5402e6e9f583db6 100644 (file)
@@ -1,8 +1,4 @@
-
-/*
- * fmt_new.c -- read format file/string and normalize
- *
- * $Id$
+/* 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
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -30,10 +26,9 @@ char *
 new_fs (char *form, char *format, char *default_fs)
 {
     struct stat st;
 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)
 
     if (form) {
        if ((fp = fopen (etcpath (form), "r")) == NULL)
@@ -60,6 +55,13 @@ new_fs (char *form, char *format, char *default_fs)
 }
 
 
 }
 
 
+void
+free_fs(void) {
+    free (formats);
+    formats = 0;
+}
+
+
 /*
  * Expand escapes in format strings
  */
 /*
  * Expand escapes in format strings
  */
@@ -98,7 +100,8 @@ normalize (char *cp)
                    break;
 
                case 0: 
                    break;
 
                case 0: 
-                   cp--;       /* fall */
+                   cp--;
+                   /* FALLTHRU */
                default: 
                    *dp++ = *cp;
                    break;
                default: 
                    *dp++ = *cp;
                    break;