From: Thomas Roessler Date: Thu, 8 Feb 2001 15:50:51 +0000 (+0000) Subject: Replace various instances of endwin() by mutt_endwin(). This should X-Git-Tag: mutt-1-3-15-rel~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df825439c00aa31bbbab2d54a5c25b02cd82d4e2;p=mutt Replace various instances of endwin() by mutt_endwin(). This should help to avoid chaotic screen output on the "second" screen. --- diff --git a/attach.c b/attach.c index 1939f45a..1a76cf00 100644 --- a/attach.c +++ b/attach.c @@ -126,7 +126,7 @@ int mutt_compose_attachment (BODY *a) { int r; - endwin (); + mutt_endwin (NULL); if ((r = mutt_system (command)) == -1) mutt_error (_("Error running \"%s\"!"), command); @@ -251,7 +251,7 @@ int mutt_edit_attachment (BODY *a) } else { - endwin (); + mutt_endwin (NULL); if (mutt_system (command) == -1) mutt_error (_("Error running \"%s\"!"), command); } @@ -471,7 +471,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr, int tempfd = -1, pagerfd = -1; if (!use_pager) - endwin (); + mutt_endwin (NULL); if (use_pager || use_pipe) { @@ -608,7 +608,7 @@ int mutt_pipe_attachment (FILE *fp, BODY *b, const char *path, char *outfile) return 0; } - endwin (); + mutt_endwin (NULL); if (fp) { @@ -905,7 +905,7 @@ int mutt_print_attachment (FILE *fp, BODY *a) strfcpy (command, entry->printcommand, sizeof (command)); piped = rfc1524_expand_command (a, newfile, type, command, sizeof (command)); - endwin (); + mutt_endwin (NULL); /* interactive program */ if (piped) @@ -955,7 +955,7 @@ int mutt_print_attachment (FILE *fp, BODY *a) { if ((ifp = fopen (newfile, "r")) != NULL) { - endwin (); + mutt_endwin (NULL); thepid = mutt_create_filter (NONULL(PrintCmd), &fpout, NULL, NULL); mutt_copy_stream (ifp, fpout); fclose (ifp); diff --git a/commands.c b/commands.c index 1eaabd36..f2ee3e45 100644 --- a/commands.c +++ b/commands.c @@ -118,7 +118,7 @@ int mutt_display_message (HEADER *cur) { fpfilterout = fpout; fpout = NULL; - /* endwin (); */ + /* mutt_endwin (NULL); */ filterpid = mutt_create_filter_fd (DisplayFilter, &fpout, NULL, NULL, -1, fileno(fpfilterout), -1); if (filterpid < 0) @@ -179,7 +179,7 @@ int mutt_display_message (HEADER *cur) { int r; - endwin (); + mutt_endwin (NULL); snprintf (buf, sizeof (buf), "%s %s", NONULL(Pager), tempfile); if ((r = mutt_system (buf)) == -1) mutt_error (_("Error running \"%s\"!"), buf); @@ -308,7 +308,7 @@ static int _mutt_pipe_message (HEADER *h, char *cmd, pid_t thepid; FILE *fpout; - endwin (); + mutt_endwin (NULL); if (h) { @@ -321,7 +321,7 @@ static int _mutt_pipe_message (HEADER *h, char *cmd, if(h->pgp & PGPENCRYPT && !pgp_valid_passphrase()) return 1; } - endwin (); + mutt_endwin (NULL); #endif thepid = mutt_create_filter (cmd, &fpout, NULL, NULL); @@ -357,7 +357,7 @@ static int _mutt_pipe_message (HEADER *h, char *cmd, if (Context->hdrs[Context->v2r[i]]->tagged) { mutt_message_hook (Context, Context->hdrs[Context->v2r[i]], M_MESSAGEHOOK); - endwin (); + mutt_endwin (NULL); thepid = mutt_create_filter (cmd, &fpout, NULL, NULL); pipe_msg (Context->hdrs[Context->v2r[i]], fpout, decode); /* add the message separator */ @@ -370,7 +370,7 @@ static int _mutt_pipe_message (HEADER *h, char *cmd, } else { - endwin (); + mutt_endwin (NULL); thepid = mutt_create_filter (cmd, &fpout, NULL, NULL); for (i = 0; i < Context->vcount; i++) { @@ -501,7 +501,7 @@ void mutt_shell_escape (void) if(buf[0]) { CLEARLINE (LINES-1); - endwin (); + mutt_endwin (NULL); fflush (stdout); if (mutt_system (buf) != 0 || option (OPTWAITKEY)) mutt_any_key_to_continue (NULL); diff --git a/curs_lib.c b/curs_lib.c index ccbb0848..347570eb 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -139,7 +139,7 @@ void mutt_edit_file (const char *editor, const char *data) { char cmd[LONG_STRING]; - endwin (); + mutt_endwin (NULL); mutt_expand_file_fmt (cmd, sizeof (cmd), editor, data); if (mutt_system (cmd) == -1) mutt_error (_("Error running \"%s\"!"), cmd); @@ -367,7 +367,7 @@ int mutt_do_pager (const char *banner, { char cmd[STRING]; - endwin (); + mutt_endwin (NULL); mutt_expand_file_fmt (cmd, sizeof(cmd), Pager, tempfile); if (mutt_system (cmd) == -1) { diff --git a/muttlib.c b/muttlib.c index 8ab0b4fe..42f8415b 100644 --- a/muttlib.c +++ b/muttlib.c @@ -1084,7 +1084,7 @@ FILE *mutt_open_read (const char *path, pid_t *thepid) char *s = safe_strdup (path); s[len - 1] = 0; - endwin (); + mutt_endwin (NULL); *thepid = mutt_create_filter (s, NULL, &f, NULL); safe_free ((void **) &s); } diff --git a/pgp.c b/pgp.c index dc5debdd..f45f1a66 100644 --- a/pgp.c +++ b/pgp.c @@ -773,7 +773,7 @@ void pgp_extract_keys_from_messages (HEADER *h) } fclose (fpout); - endwin (); + mutt_endwin (NULL); pgp_invoke_import (tempfname); mutt_any_key_to_continue (NULL); @@ -820,7 +820,7 @@ void pgp_extract_keys_from_attachment_list (FILE *fp, int tag, BODY *top) return; } - endwin(); + mutt_endwin (NULL); set_option(OPTDONTHANDLEPGPKEYS); for(; top; top = top->next) @@ -1566,7 +1566,7 @@ int pgp_protect (HEADER *msg, char *pgpkeylist) mutt_message _("Invoking PGP..."); if (!isendwin ()) - endwin (); + mutt_endwin (NULL); if (traditional) { diff --git a/recvattach.c b/recvattach.c index a055d5af..a1de0dda 100644 --- a/recvattach.c +++ b/recvattach.c @@ -577,7 +577,7 @@ void mutt_pipe_attachment_list (FILE *fp, int tag, BODY *top, int filter) if (!filter && !option (OPTATTACHSPLIT)) { - endwin (); + mutt_endwin (NULL); thepid = mutt_create_filter (buf, &state.fpout, NULL, NULL); pipe_attachment_list (buf, fp, tag, top, filter, &state); fclose (state.fpout); @@ -676,7 +676,7 @@ void mutt_print_attachment_list (FILE *fp, int tag, BODY *top) { if (!can_print (top, tag)) return; - endwin (); + mutt_endwin (NULL); memset (&state, 0, sizeof (STATE)); thepid = mutt_create_filter (NONULL (PrintCmd), &state.fpout, NULL, NULL); print_attachment_list (fp, tag, top, &state); diff --git a/remailer.c b/remailer.c index 543b2d78..3077ea22 100644 --- a/remailer.c +++ b/remailer.c @@ -758,7 +758,7 @@ int mix_send_message (LIST *chain, const char *tempfile) } if (!option (OPTNOCURSES)) - endwin (); + mutt_endwin (NULL); if ((i = mutt_system (cmd))) {