{
char olddir[BUFSIZ];
int r;
+
+ /* 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)
{
char olddir[BUFSIZ];
FILE *f;
+
+ /* 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)