From: David Levine Date: Mon, 3 Dec 2012 14:54:21 +0000 (-0600) Subject: Fix to 25581a94c5113eb78b2baf7110408df96efc4418: always set $editalt, X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=7fd676d57355fd26c1127a79d9ba805973928316;p=mmh Fix to 25581a94c5113eb78b2baf7110408df96efc4418: always set $editalt, even without -atfile. --- diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index d54877e..3890537 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -683,7 +683,7 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp, *ed = defaulteditor; } - if (altmsg && atfile) { + if (altmsg) { if (mp == NULL || *altmsg == '/' || cwd == NULL) strncpy (altpath, altmsg, sizeof(altpath)); else @@ -693,17 +693,19 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp, else snprintf (linkpath, sizeof(linkpath), "%s/%s", cwd, LINK); - unlink (linkpath); + if (atfile) { + unlink (linkpath); #ifdef HAVE_LSTAT - if (link (altpath, linkpath) == NOTOK) { - symlink (altpath, linkpath); - slinked = 1; - } else { - slinked = 0; - } + if (link (altpath, linkpath) == NOTOK) { + symlink (altpath, linkpath); + slinked = 1; + } else { + slinked = 0; + } #else /* not HAVE_LSTAT */ - link (altpath, linkpath); + link (altpath, linkpath); #endif /* not HAVE_LSTAT */ + } } context_save (); /* save the context file */