On Mon, Feb 25, 2002 at 02:24:27PM -0500, Mike Schiraldi wrote: > Looks like we've got a display-corruption bug in current CVS -- when a > message arrives whose "From" address doesn't match any in the S/MIME cert > (like this message), the screen gets garbled. > > A warning should absolutely be displayed, but should > mutt_any_key_to_continue() be called? A previous bugfix in another part of > smime.c mentioned that this is bad, and it added a sleep(5) call whose > purpose i didn't understand -- surely there must be a more elegant way?
the following fixes the error. it again introduces some sleep (who included the first one ?) that is needed here to display both error messages. we could drop one of them, and thus get rid of it. the (obviously not so) elegant solution was calling any_key.... alternatively, we could just printf() the first (ie _not_ use mutt_error), wait for any_key, and then mutt_error() the second/final warning. diff -u smime.c~ smime.c --- smime.c~ Wed Feb 13 15:05:49 2002 +++ smime.c Tue Feb 26 12:11:33 2002 @@ -915,15 +915,16 @@ if (ret == -1) { - mutt_copy_stream (fperr, stdout); mutt_endwin(NULL); - mutt_error (_("Alert: No mailbox specified in certificate.\n")); + mutt_copy_stream (fperr, stdout); + mutt_any_key_to_continue (_("Error: unable to create OpenSSL subprocess!")); +mutt_error (_("Alert: No mailbox specified in certificate.\n")); ret = 1; } else if (!ret) { - mutt_endwin(NULL); +/* mutt_endwin(NULL); */ mutt_error (_("Alert: Certificate does *NOT* belong to \"%s\".\n"), mailbox); + mutt_sleep(5); ret = 1; } else ret = 0; @@ -1455,7 +1456,10 @@ { mutt_unlink(tempfname); if (smime_handle_cert_email (certfile, mbox, 0, NULL, NULL)) - mutt_any_key_to_continue(NULL); + { + if(isendwin()) + mutt_any_key_to_continue(NULL); + } else retval = 0; mutt_unlink(certfile);
msg24793/pgp00000.pgp
Description: PGP signature