- if (altmsg) {
- if (!mp || *altmsg == '/' || !cwd)
- strncpy(altpath, altmsg, sizeof(altpath));
- else
- snprintf(altpath, sizeof(altpath), "%s/%s",
- mp->foldpath, altmsg);
- if (!cwd)
- strncpy(linkpath, altmsglink, sizeof(linkpath));
- else
- snprintf(linkpath, sizeof(linkpath), "%s/%s",
- cwd, altmsglink);
- unlink(linkpath);
-#ifdef HAVE_LSTAT
- if (link(altpath, linkpath) == NOTOK) {
- symlink(altpath, linkpath);
- slinked = 1;
- } else {
- slinked = 0;
- }
-#else /* not HAVE_LSTAT */
- link(altpath, linkpath);
-#endif /* not HAVE_LSTAT */
- }
-
- context_save(); /* save the context file */