X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/0bfb53a23531bea3aaeadcd1a6f6c372eef96612..a34ce71c09fe1d5dda955bbd987f3add2b3c368e:/uip/whatnowproc.c diff --git a/uip/whatnowproc.c b/uip/whatnowproc.c index 05dc8ff3..a0186f55 100644 --- a/uip/whatnowproc.c +++ b/uip/whatnowproc.c @@ -1,6 +1,4 @@ - -/* - * whatnowproc.c -- exec the "whatnowproc" +/* whatnowproc.c -- exec the "whatnowproc" * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for @@ -26,7 +24,7 @@ what_now (char *ed, int nedit, int use, char *file, char *altmsg, int dist, { int found, k, msgnum, vecp; int len, buflen; - register char *bp; + char *bp; char buffer[BUFSIZ], *vec[MAXARGS]; vecp = 0; @@ -99,8 +97,11 @@ what_now (char *ed, int nedit, int use, char *file, char *altmsg, int dist, context_save (); /* save the context file */ fflush (stdout); - if (cwd) - chdir (cwd); + if (cwd) { + if (chdir (cwd) < 0) { + advise (cwd, "chdir"); + } + } /* * If the "whatnowproc" is the nmh command "whatnow",