X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Ffmt_new.c;h=4e5637871b3bccc022d2b4e2d2d55d058f1c9479;hb=246ca516a0f7b870316116bc184347b0fb2bc00b;hp=4acabe796b991bf316e320d81b3a1a13224bd44f;hpb=a485ed478abbd599d8c9aab48934e7a26733ecb1;p=mmh diff --git a/sbr/fmt_new.c b/sbr/fmt_new.c index 4acabe7..4e56378 100644 --- a/sbr/fmt_new.c +++ b/sbr/fmt_new.c @@ -1,10 +1,10 @@ /* - * 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. - */ +** 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 @@ -14,55 +14,55 @@ static char *formats = 0; /* - * static prototypes - */ -static void normalize (char *); +** static prototypes +*/ +static void normalize(char *); /* - * Get new format string - */ +** Get new format string +*/ char * -new_fs (char *form, char *format, char *default_fs) +new_fs(char *form, char *format, char *default_fs) { struct stat st; register FILE *fp; if (formats) - free (formats); + free(formats); if (form) { - if ((fp = fopen (etcpath (form), "r")) == NULL) - adios (form, "unable to open format file"); + if ((fp = fopen(etcpath(form), "r")) == NULL) + adios(form, "unable to open format file"); - if (fstat (fileno (fp), &st) == -1) - adios (form, "unable to stat format file"); + if (fstat(fileno(fp), &st) == -1) + adios(form, "unable to stat format file"); - formats = mh_xmalloc ((size_t) st.st_size + 1); + formats = mh_xmalloc((size_t) st.st_size + 1); - if (read (fileno(fp), formats, (int) st.st_size) != st.st_size) - adios (form, "error reading format file"); + if (read(fileno(fp), formats, (int) st.st_size) != st.st_size) + adios(form, "error reading format file"); formats[st.st_size] = '\0'; - fclose (fp); + fclose(fp); } else { - formats = getcpy (format ? format : default_fs); + formats = getcpy(format ? format : default_fs); } - normalize (formats); /* expand escapes */ + normalize(formats); /* expand escapes */ return formats; } /* - * Expand escapes in format strings - */ +** Expand escapes in format strings +*/ static void -normalize (char *cp) +normalize(char *cp) { char *dp;