From: Ken Hornstein Date: Thu, 6 Mar 2014 19:59:35 +0000 (-0500) Subject: Prevent crash if editfile() is called and both "*ed" and editsave X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/5d6bfc17257fca07962fe000e964c0f690e852d6?hp=66bf17b229b5bd066e5cdc919cc6d41f086a7ed2 Prevent crash if editfile() is called and both "*ed" and editsave are NULL. This can happen if you call "mime" and then run "edit" without any arguments, if you're running whatnow standalone. --- diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index f0f9a2c5..774d130c 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -651,7 +651,7 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp, int slinked = 0; /* Was there a previous edit session? */ - if (reedit) { + if (reedit && (*ed || edsave)) { if (!*ed) { /* no explicit editor */ *ed = edsave; /* so use the previous one */ if ((cp = r1bindex (*ed, '/')) == NULL)