/*
- * 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 <h/mh.h>
#include <fcntl.h>
static jmp_buf sigenv;
/*
- * prototypes
- */
+** prototypes
+*/
int getln (char *, int);
static int chrcnv (char *);
static void chrdsp (char *, char);
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:
doteof = 0;
continue;
}
- } else {
- if (!drft)
- drft = cp;
+ } else if (!drft) {
+ drft = cp;
}
if (!drft)
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;
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;
}
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;