diff --git a/src/libCom/iocsh/iocsh.cpp b/src/libCom/iocsh/iocsh.cpp index f2d42b973..a3cbd22a1 100644 --- a/src/libCom/iocsh/iocsh.cpp +++ b/src/libCom/iocsh/iocsh.cpp @@ -798,7 +798,8 @@ iocshBody (const char *pathname, const char *commandLine) int epicsShareAPI iocsh (const char *pathname) { - epicsEnvSet("IOCSH_STARTUP_SCRIPT", pathname); + if (pathname) + epicsEnvSet("IOCSH_STARTUP_SCRIPT", pathname); return iocshBody(pathname, NULL); }