X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fwhatnowsbr.c;h=389053727c45213dcdfc0c525e39c41a2a5c358f;hb=492101aee1185135f239b3aabd5b2494f748c931;hp=d54877e343cf1bfd08b28b938ae93af11a297453;hpb=9b70e8396d50989db2177547515594bc15ee8b17;p=mmh 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 */