char **argp, **arguments;
struct stat st;
char *attach = NMH_ATTACH_HEADER;/* attachment header field name */
char **argp, **arguments;
struct stat st;
char *attach = NMH_ATTACH_HEADER;/* attachment header field name */
- char cwd[MAXPATHLEN + 1]; /* current working directory */
- char file[MAXPATHLEN + 1]; /* file name buffer */
- char shell[MAXPATHLEN + 1]; /* shell response buffer */
+ char cwd[PATH_MAX + 1]; /* current working directory */
+ char file[PATH_MAX + 1]; /* file name buffer */
+ char shell[PATH_MAX + 1]; /* shell response buffer */
FILE *f; /* read pointer for bgnd proc */
char *l; /* set on -l to alist command */
int n; /* set on -n to alist command */
FILE *f; /* read pointer for bgnd proc */
char *l; /* set on -l to alist command */
int n; /* set on -n to alist command */
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] [file]", invo_name);
print_help (buf, whatnowswitches, 1);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] [file]", invo_name);
print_help (buf, whatnowswitches, 1);
}
else {
writesomecmd(buf, BUFSIZ, "cd", "pwd", argp);
}
else {
writesomecmd(buf, BUFSIZ, "cd", "pwd", argp);
* new C99 mandated 'number of chars that would have been written'
*/
/* length checks here and inside the loop allow for the
* new C99 mandated 'number of chars that would have been written'
*/
/* length checks here and inside the loop allow for the
if (ln < 0 || ln + trailln > bufsz)
adios((char *)0, "arguments too long");
if (ln < 0 || ln + trailln > bufsz)
adios((char *)0, "arguments too long");
+
+ /* ensure that $SHELL exists, as the cmd was written relying on
+ a non-blank $SHELL... */
+ setenv("SHELL","/bin/sh",0); /* don't overwrite */
+
if (getcwd(olddir, sizeof(olddir)) == 0)
adios("getcwd", "could not get working directory");
if (chdir(dir) != 0)
if (getcwd(olddir, sizeof(olddir)) == 0)
adios("getcwd", "could not get working directory");
if (chdir(dir) != 0)
+
+ /* ensure that $SHELL exists, as the cmd was written relying on
+ a non-blank $SHELL... */
+ setenv("SHELL","/bin/sh",0); /* don't overwrite */
+
if (getcwd(olddir, sizeof(olddir)) == 0)
adios("getcwd", "could not get working directory");
if (chdir(dir) != 0)
if (getcwd(olddir, sizeof(olddir)) == 0)
adios("getcwd", "could not get working directory");
if (chdir(dir) != 0)
/* Translate MIME composition file, if necessary */
if ((cp = context_find ("automimeproc"))
&& (!strcmp (cp, "1"))
/* Translate MIME composition file, if necessary */
if ((cp = context_find ("automimeproc"))
&& (!strcmp (cp, "1"))
&& check_draft (file)
&& (buildfile (NULL, file) == NOTOK))
return 0;
/* For backwards compatibility */
if ((cp = context_find ("automhnproc"))
&& check_draft (file)
&& (buildfile (NULL, file) == NOTOK))
return 0;
/* For backwards compatibility */
if ((cp = context_find ("automhnproc"))
&& check_draft (file)
&& (i = editfile (&cp, NULL, file, NOUSE, NULL, NULL, NULL, 0, 0)))
return 0;
&& check_draft (file)
&& (i = editfile (&cp, NULL, file, NOUSE, NULL, NULL, NULL, 0, 0)))
return 0;
vec[vecp++] = --cp;
if (!(cp = *argp++) || *cp == '-') {
advise (NULL, "missing argument to %s", argp[-2]);
vec[vecp++] = --cp;
if (!(cp = *argp++) || *cp == '-') {
advise (NULL, "missing argument to %s", argp[-2]);