From 7fd676d57355fd26c1127a79d9ba805973928316 Mon Sep 17 00:00:00 2001 From: David Levine Date: Mon, 3 Dec 2012 08:54:21 -0600 Subject: [PATCH] Fix to 25581a94c5113eb78b2baf7110408df96efc4418: always set $editalt, even without -atfile. --- uip/whatnowsbr.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) 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 */ -- 1.7.10.4