- }
- unlink (tmpfil);
- done (1);
- }
- if (i != 0 || (field[0] != '\n' && field[0] != 0)) {
- fprintf (out, "%s:", name);
- do {
- if (field[0] != ' ' && field[0] != '\t')
- putc (' ', out);
- fprintf (out, "%s", field);
- } while (i == 1
- && (i = getln (field, sizeof(field))) >= 0);
- if (i == -1)
- goto abort;
- }
- }
-
- if (state == FLDEOF) { /* moby hack */
- fprintf (out, "--------\n");
- printf ("--------\n");
- if (!body)
- break;
- goto no_body;
- }
- continue;
-
- case BODY:
- case BODYEOF:
- case FILEEOF:
- if (!body)
- break;
- fprintf (out, "--------\n");
- if (field[0] == 0 || !prepend)
- printf ("--------\n");
- if (field[0]) {
- if (prepend && body) {
- printf ("\n--------Enter initial text\n\n");
- fflush (stdout);
- for (;;) {
- getln (buffer, sizeof(buffer));
- if (doteof && buffer[0] == '.' && buffer[1] == '\n')
- break;
- if (buffer[0] == 0)
- break;
- fprintf (out, "%s", buffer);
- }
- }
-
- do {
- fprintf (out, "%s", field);
- if (!rapid && !sigint)
- printf ("%s", field);
- } while (state == BODY &&
- (state = m_getfld (state, name, field, sizeof(field), in)));
- if (prepend || !body)
- break;
- else
- printf ("\n--------Enter additional text\n\n");
- }
+ }
+ unlink(tmpfil);
+ done(1);
+ }
+ if (i != 0 || (field[0] != '\n' && field[0] != 0)) {
+ fprintf(out, "%s:", name);
+ do {
+ if (field[0] != ' ' && field[0] != '\t')
+ putc(' ', out);
+ fprintf(out, "%s", field);
+ } while (i == 1 && (i = getln(field, sizeof(field))) >= 0);
+ if (i == -1)
+ goto abort;
+ }
+ }
+
+ if (state == FLDEOF) { /* moby hack */
+ fprintf(out, "--------\n");
+ printf("--------\n");
+ if (!body)
+ break;
+ goto no_body;
+ }
+ continue;
+
+ case BODY:
+ case BODYEOF:
+ case FILEEOF:
+ if (!body)
+ break;
+ fprintf(out, "--------\n");
+ if (field[0] == 0 || !prepend)
+ printf("--------\n");
+ if (field[0]) {
+ if (prepend && body) {
+ printf("\n--------Enter initial text\n\n");
+ fflush(stdout);
+ for (;;) {
+ getln(buffer, sizeof(buffer));
+ if (doteof && buffer[0] == '.' && buffer[1] == '\n')
+ break;
+ if (buffer[0] == 0)
+ break;
+ fprintf(out, "%s", buffer);
+ }
+ }
+
+ do {
+ fprintf(out, "%s", field);
+ if (!rapid && !sigint)
+ printf("%s", field);
+ } while (state == BODY &&
+ (state = m_getfld(state, name, field, sizeof(field), in)));
+ if (prepend || !body)
+ break;
+ else
+ printf ("\n--------Enter additional text\n\n");
+ }