X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/a670c9d22ff3a00459677c62d1929818c4e4c4e6..7711f3fc00259e55f630cfe6104eff3083dc9d77:/uip/whatnowsbr.c diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index 6e08d3eb..21fb1519 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -321,7 +321,9 @@ WhatNow (int argc, char **argv) writesomecmd(buf, BUFSIZ, "cd", "pwd", argp); } if ((f = popen_in_dir(cwd, buf, "r")) != (FILE *)0) { - fgets(cwd, sizeof (cwd), f); + if (fgets(cwd, sizeof (cwd), f) == NULL) { + advise (buf, "fgets"); + } if (strchr(cwd, '\n') != (char *)0) *strchr(cwd, '\n') = '\0'; @@ -444,9 +446,6 @@ WhatNow (int argc, char **argv) annotate(drft, ATTACH_FIELD, file, 1, 0, -2, 1); if (verbose) { ctype = mime_type(file); - } - - if (verbose) { printf ("Attaching %s as a %s\n", file, ctype); free (ctype); } @@ -691,7 +690,9 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp, if (atfile) { (void) m_unlink (linkpath); if (link (altpath, linkpath) == NOTOK) { - symlink (altpath, linkpath); + if (symlink (altpath, linkpath) < 0) { + adios (linkpath, "symlink"); + } slinked = 1; } else { slinked = 0; @@ -709,8 +710,11 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp, break; case OK: - if (cwd) - chdir (cwd); + if (cwd) { + if (chdir (cwd) < 0) { + advise (cwd, "chdir"); + } + } if (altmsg) { if (mp) m_putenv ("mhfolder", mp->foldpath);