X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/81a21a9a97d8633f6d6231e31fdb6e328d0d3ff2..9f1e781a5c2beb9df943c832300a3f5bee1e4ed3:/sbr/fmt_new.c diff --git a/sbr/fmt_new.c b/sbr/fmt_new.c index c1bc7c73..97e2a7ad 100644 --- a/sbr/fmt_new.c +++ b/sbr/fmt_new.c @@ -1,16 +1,13 @@ - -/* - * 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 * complete copyright information. */ -#include -#include +#include "h/mh.h" +#include "error.h" +#include "h/utils.h" #define QUOTE '\\' @@ -30,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) @@ -60,6 +56,14 @@ new_fs (char *form, char *format, char *default_fs) } +void +free_fs(void) +{ + free (formats); + formats = 0; +} + + /* * Expand escapes in format strings */ @@ -98,7 +102,8 @@ normalize (char *cp) break; case 0: - cp--; /* fall */ + cp--; + /* FALLTHRU */ default: *dp++ = *cp; break;