{
int r;
- mutt_endwin(NULL);
+ mutt_endwin();
r = mutt_system(command);
if (r == -1)
mutt_error(_("Error running \"%s\"!"), command);
}
else
{
- mutt_endwin(NULL);
+ mutt_endwin();
if (mutt_system(command) == -1)
{
mutt_error(_("Error running \"%s\"!"), command);
int tempfd = -1, pagerfd = -1;
if (!use_pager)
- mutt_endwin(NULL);
+ mutt_endwin();
if (use_pager || use_pipe)
{
}
}
- mutt_endwin(NULL);
+ mutt_endwin();
if (fp)
{
mutt_str_strfcpy(command, entry->printcommand, sizeof(command));
piped = rfc1524_expand_command(a, newfile, type, command, sizeof(command));
- mutt_endwin(NULL);
+ mutt_endwin();
/* interactive program */
if (piped)
mutt_debug(2, "successfully opened %s read-only\n", newfile);
- mutt_endwin(NULL);
+ mutt_endwin();
thepid = mutt_create_filter(NONULL(PrintCommand), &fpout, NULL, NULL);
if (thepid < 0)
{
{
int r;
- mutt_endwin(NULL);
+ mutt_endwin();
snprintf(buf, sizeof(buf), "%s %s", NONULL(Pager), tempfile);
r = mutt_system(buf);
if (r == -1)
if (h->security & ENCRYPT && !crypt_valid_passphrase(h->security))
return 1;
}
- mutt_endwin(NULL);
+ mutt_endwin();
thepid = mutt_create_filter(cmd, &fpout, NULL, NULL);
if (thepid < 0)
continue;
mutt_message_hook(Context, Context->hdrs[i], MUTT_MESSAGEHOOK);
- mutt_endwin(NULL);
+ mutt_endwin();
thepid = mutt_create_filter(cmd, &fpout, NULL, NULL);
if (thepid < 0)
{
}
else
{
- mutt_endwin(NULL);
+ mutt_endwin();
thepid = mutt_create_filter(cmd, &fpout, NULL, NULL);
if (thepid < 0)
{
if (buf[0])
{
mutt_window_clearline(MuttMessageWindow, 0);
- mutt_endwin(NULL);
+ mutt_endwin();
fflush(stdout);
int rc = mutt_system(buf);
if (rc == -1)
{
char cmd[LONG_STRING];
- mutt_endwin(NULL);
+ mutt_endwin();
mutt_expand_file_fmt(cmd, sizeof(cmd), editor, data);
if (mutt_system(cmd) != 0)
{
mutt_window_clrtoeol(MuttMessageWindow);
}
-void mutt_endwin(const char *msg)
+void mutt_endwin(void)
{
- int e = errno;
+ if (OPT_NO_CURSES)
+ return;
- if (!OPT_NO_CURSES)
- {
- /* at least in some situations (screen + xterm under SuSE11/12) endwin()
- * doesn't properly flush the screen without an explicit call.
- */
- mutt_refresh();
- endwin();
- }
+ int e = errno;
- if (msg && *msg)
- {
- puts(msg);
- fflush(stdout);
- }
+ /* at least in some situations (screen + xterm under SuSE11/12) endwin()
+ * doesn't properly flush the screen without an explicit call. */
+ mutt_refresh();
+ endwin();
errno = e;
}
{
char cmd[STRING];
- mutt_endwin(NULL);
+ mutt_endwin();
mutt_expand_file_fmt(cmd, sizeof(cmd), Pager, tempfile);
if (mutt_system(cmd) == -1)
{
if (op == '?')
{
- mutt_endwin(NULL);
+ mutt_endwin();
fflush(stdout);
printf(_("\nCurrent attachments settings:\n\n"));
print_attach_list(&AttachAllow, '+', "A");
{
if (!found)
{
- mutt_endwin(NULL);
+ mutt_endwin();
found = 1;
}
puts(*envp);
{
if (!HomeDir)
{
- mutt_endwin(NULL);
+ mutt_endwin();
fputs(_("unable to determine home directory"), stderr);
exit(1);
}
Username = mutt_str_strdup(p);
else
{
- mutt_endwin(NULL);
+ mutt_endwin();
fputs(_("unable to determine username"), stderr);
exit(1);
}
*/
if ((uname(&utsname)) == -1)
{
- mutt_endwin(NULL);
+ mutt_endwin();
perror(_("unable to determine nodename via uname()"));
exit(1);
}
np->data = mutt_str_strdup(buffer);
if (access(np->data, F_OK))
{
+ mutt_endwin();
snprintf(buffer, sizeof(buffer), "%s: %s", np->data, strerror(errno));
- mutt_endwin(buffer);
+ puts(buffer);
exit(1);
}
}
void mutt_exit(int code)
{
- mutt_endwin(NULL);
+ mutt_endwin();
exit(code);
}
mutt_flushinp();
ci_send_message(SENDPOSTPONED, NULL, NULL, NULL, NULL);
mutt_free_windows();
- mutt_endwin(NULL);
+ mutt_endwin();
}
else if (subject || msg || sendflags || draft_file || include_file ||
!STAILQ_EMPTY(&attach) || optind < argc)
{
if (url_parse_mailto(msg->env, &bodytext, argv[i]) < 0)
{
- if (!OPT_NO_CURSES)
- mutt_endwin(NULL);
+ mutt_endwin();
fputs(_("Failed to parse mailto: link\n"), stderr);
exit(1);
}
if (!draft_file && Autoedit && !msg->env->to && !msg->env->cc)
{
- if (!OPT_NO_CURSES)
- mutt_endwin(NULL);
+ mutt_endwin();
fputs(_("No recipients specified.\n"), stderr);
exit(1);
}
fin = fopen(expanded_infile, "r");
if (!fin)
{
- if (!OPT_NO_CURSES)
- mutt_endwin(NULL);
+ mutt_endwin();
perror(expanded_infile);
exit(1);
}
fout = mutt_file_fopen(tempfile, "w");
if (!fout)
{
- if (!OPT_NO_CURSES)
- mutt_endwin(NULL);
+ mutt_endwin();
perror(tempfile);
mutt_file_fclose(&fin);
FREE(&tempfile);
fin = fopen(tempfile, "r");
if (!fin)
{
- if (!OPT_NO_CURSES)
- mutt_endwin(NULL);
+ mutt_endwin();
perror(tempfile);
FREE(&tempfile);
exit(1);
msg->content = a = mutt_make_file_attach(np->data);
if (!a)
{
- if (!OPT_NO_CURSES)
- mutt_endwin(NULL);
+ mutt_endwin();
fprintf(stderr, _("%s: unable to attach file.\n"), np->data);
mutt_list_free(&attach);
exit(1);
{
if (truncate(expanded_infile, 0) == -1)
{
- if (!OPT_NO_CURSES)
- mutt_endwin(NULL);
+ mutt_endwin();
perror(expanded_infile);
exit(1);
}
fout = mutt_file_fopen(expanded_infile, "a");
if (!fout)
{
- if (!OPT_NO_CURSES)
- mutt_endwin(NULL);
+ mutt_endwin();
perror(expanded_infile);
exit(1);
}
fputc('\n', fout);
if ((mutt_write_mime_body(msg->content, fout) == -1))
{
- if (!OPT_NO_CURSES)
- mutt_endwin(NULL);
+ mutt_endwin();
mutt_file_fclose(&fout);
exit(1);
}
}
mutt_free_windows();
- if (!OPT_NO_CURSES)
- mutt_endwin(NULL);
+ mutt_endwin();
if (rv != 0)
exit(1);
{
if (!mutt_buffy_check(false))
{
- mutt_endwin(_("No mailbox with new mail."));
+ mutt_endwin();
+ puts(_("No mailbox with new mail."));
exit(1);
}
folder[0] = '\0';
CurrentNewsSrv = nntp_select_server(NewsServer, false);
if (!CurrentNewsSrv)
{
- mutt_endwin(ErrorBuf);
+ mutt_endwin();
+ puts(ErrorBuf);
exit(1);
}
}
#endif
if (!Incoming)
{
- mutt_endwin(_("No incoming mailboxes defined."));
+ mutt_endwin();
+ puts(_("No incoming mailboxes defined."));
exit(1);
}
folder[0] = '\0';
mutt_select_file(folder, sizeof(folder), MUTT_SEL_FOLDER | MUTT_SEL_BUFFY, NULL, NULL);
if (folder[0] == '\0')
{
- mutt_endwin(NULL);
+ mutt_endwin();
exit(0);
}
}
switch (mx_check_empty(folder))
{
case -1:
- mutt_endwin(strerror(errno));
+ mutt_endwin();
+ puts(strerror(errno));
exit(1);
case 1:
- mutt_endwin(_("Mailbox is empty."));
+ mutt_endwin();
+ puts(_("Mailbox is empty."));
exit(1);
}
}
#endif
mutt_free_opts();
mutt_free_windows();
- mutt_endwin(ErrorBuf);
+ mutt_endwin();
+ puts(ErrorBuf);
}
exit(0);
struct Event mutt_getch(void);
-void mutt_endwin(const char *msg);
+void mutt_endwin(void);
void mutt_flushinp(void);
void mutt_refresh(void);
void mutt_resize_screen(void);
char *p = mutt_str_strdup(path);
p[len - 1] = 0;
- mutt_endwin(NULL);
+ mutt_endwin();
*thepid = mutt_create_filter(p, NULL, &f, NULL);
FREE(&p);
}
{
/* they really want to send it inline... go for it */
if (!isendwin())
- mutt_endwin(_("Invoking PGP..."));
+ {
+ mutt_endwin();
+ puts(_("Invoking PGP..."));
+ }
pbody = crypt_pgp_traditional_encryptsign(msg->content, flags, keylist);
if (pbody)
{
}
if (!isendwin())
- mutt_endwin(NULL);
+ mutt_endwin();
if ((WithCrypto & APPLICATION_SMIME))
tmp_smime_pbody = msg->content;
mutt_copy_message_ctx(fpout, Context, hi, MUTT_CM_DECODE | MUTT_CM_CHARCONV, 0);
fflush(fpout);
- mutt_endwin(_("Trying to extract PGP keys...\n"));
+ mutt_endwin();
+ puts(_("Trying to extract PGP keys...\n"));
crypt_pgp_invoke_import(tempfname);
}
mbox = tmp ? tmp->mailbox : NULL;
if (mbox)
{
- mutt_endwin(_("Trying to extract S/MIME certificates...\n"));
+ mutt_endwin();
+ puts(_("Trying to extract S/MIME certificates...\n"));
crypt_smime_invoke_import(tempfname, mbox);
tmp = NULL;
}
{
mutt_copy_message_ctx(fpout, Context, h, MUTT_CM_DECODE | MUTT_CM_CHARCONV, 0);
fflush(fpout);
- mutt_endwin(_("Trying to extract PGP keys...\n"));
+ mutt_endwin();
+ puts(_("Trying to extract PGP keys...\n"));
crypt_pgp_invoke_import(tempfname);
}
return;
}
- mutt_endwin(NULL);
+ mutt_endwin();
OPT_DONT_HANDLE_PGP_KEYS = true;
for (; top; top = top->next)
if (rc == -1)
{
- mutt_endwin(NULL);
+ mutt_endwin();
mutt_file_copy_stream(fperr, stdout);
mutt_any_key_to_continue(_("Error: unable to create OpenSSL subprocess!"));
rc = 1;
empty = (fgetc(fpout) == EOF);
if (empty)
{
- mutt_endwin(NULL);
+ mutt_endwin();
mutt_file_copy_stream(fperr, stdout);
mutt_any_key_to_continue(NULL);
mutt_file_fclose(&fpout);
}
}
- mutt_endwin(NULL);
+ mutt_endwin();
certfile = smime_extract_certificate(infile);
if (certfile)
{
- mutt_endwin(NULL);
+ mutt_endwin();
thepid = smime_invoke(&smimein, NULL, NULL, -1, fileno(fpout), fileno(fperr), certfile,
NULL, NULL, NULL, NULL, NULL, NULL, SmimeImportCertCommand);
if (!filter && !AttachSplit)
{
- mutt_endwin(NULL);
+ mutt_endwin();
thepid = mutt_create_filter(buf, &state.fpout, NULL, NULL);
pipe_attachment_list(buf, actx, fp, tag, top, filter, &state);
mutt_file_fclose(&state.fpout);
{
if (!can_print(actx, top, tag))
return;
- mutt_endwin(NULL);
+ mutt_endwin();
thepid = mutt_create_filter(NONULL(PrintCommand), &state.fpout, NULL, NULL);
print_attachment_list(actx, fp, tag, top, &state);
mutt_file_fclose(&state.fpout);
(np == STAILQ_FIRST(chain)) ? " -l " : ",", cd_quoted);
}
- if (!OPT_NO_CURSES)
- mutt_endwin(NULL);
+ mutt_endwin();
i = mutt_system(cmd);
if (i != 0)