From 5d6bfc17257fca07962fe000e964c0f690e852d6 Mon Sep 17 00:00:00 2001 From: Ken Hornstein Date: Thu, 6 Mar 2014 14:59:35 -0500 Subject: [PATCH] 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. --- uip/whatnowsbr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.56.0