]> diplodocus.org Git - nmh/commitdiff
Prevent crash if editfile() is called and both "*ed" and editsave
authorKen Hornstein <kenh@pobox.com>
Thu, 6 Mar 2014 19:59:35 +0000 (14:59 -0500)
committerKen Hornstein <kenh@pobox.com>
Thu, 6 Mar 2014 19:59:35 +0000 (14:59 -0500)
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

index f0f9a2c58ce1b1735ce15de62000418cc9ff6d56..774d130c7c7eeead1a4c1fce1eba30f114f494c3 100644 (file)
@@ -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)