X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fprompter.c;h=88a56dfb5ca4226af7ad01c1a7c2582a900a00e8;hp=f92eda12e93902da8b4b995e49488dc0df079ef8;hb=ced6090a330d3d83d0bce709f756aa3d7d65fea4;hpb=337338b404931f06f0db2119c9e145e8ca5a9860 diff --git a/uip/prompter.c b/uip/prompter.c index f92eda1..88a56df 100644 --- a/uip/prompter.c +++ b/uip/prompter.c @@ -1,10 +1,10 @@ /* - * prompter.c -- simple prompting editor front-end - * - * 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. - */ +** prompter.c -- simple prompting editor front-end +** +** 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 @@ -87,8 +87,8 @@ static int sigint = 0; static jmp_buf sigenv; /* - * prototypes - */ +** prototypes +*/ int getln (char *, int); static int chrcnv (char *); static void chrdsp (char *, char); @@ -128,8 +128,9 @@ main (int argc, char **argv) adios (NULL, "-%s unknown", cp); case HELPSW: - snprintf (buffer, sizeof(buffer), "%s [switches] file", - invo_name); + snprintf (buffer, sizeof(buffer), + "%s [switches] file", + invo_name); print_help (buffer, switches, 1); done (1); case VERSIONSW: @@ -173,9 +174,8 @@ main (int argc, char **argv) doteof = 0; continue; } - } else { - if (!drft) - drft = cp; + } else if (!drft) { + drft = cp; } if (!drft) @@ -184,13 +184,14 @@ main (int argc, char **argv) adios (drft, "unable to open"); tfile = m_mktemp2(NULL, invo_name, NULL, &out); - if (tfile == NULL) adios("prompter", "unable to create temporary file"); + if (tfile == NULL) + adios("prompter", "unable to create temporary file"); chmod (tmpfil, 0600); strncpy (tmpfil, tfile, sizeof(tmpfil)); /* - * Are we changing the kill or erase character? - */ + ** Are we changing the kill or erase character? + */ if (killp || erasep) { #ifdef HAVE_TERMIOS_H cc_t save_erase, save_kill; @@ -237,10 +238,10 @@ main (int argc, char **argv) fflush (stdout); /* - * We set the kill and erase character back to original - * setup in terminal structure so we can easily - * restore it upon exit. - */ + ** We set the kill and erase character back to original + ** setup in terminal structure so we can easily + ** restore it upon exit. + */ KILL = save_kill; ERASE = save_erase; } @@ -249,17 +250,17 @@ main (int argc, char **argv) SIGNAL2 (SIGINT, intrser); /* - * Loop through the lines of the draft skeleton. - */ + ** Loop through the lines of the draft skeleton. + */ for (state = FLD;;) { switch (state = m_getfld (state, name, field, sizeof(field), in)) { case FLD: case FLDEOF: case FLDPLUS: /* - * Check if the value of field contains anything - * other than space or tab. - */ + ** Check if the value of field contains + ** anything other than space or tab. + */ for (cp = field; *cp; cp++) if (*cp != ' ' && *cp != '\t') break;