diff --git a/configure/os/CONFIG.Common.vxWorksCommon b/configure/os/CONFIG.Common.vxWorksCommon index d6d759965..7ed8e3b69 100644 --- a/configure/os/CONFIG.Common.vxWorksCommon +++ b/configure/os/CONFIG.Common.vxWorksCommon @@ -52,7 +52,7 @@ GCC_RANLIB = #-------------------------------------------------- # C++ host processing NM = $(GNU_BIN)/$(CMPLR_PREFIX)nm$(CMPLR_SUFFIX)$(HOSTEXE) -ifneq ($(wildcard $(GNU_BIN)/munch.tcl),) +ifeq ($(wildcard $(GNU_BIN)/munch.tcl),$(wildcard $(GNU_BIN)/munch.tcl)) ##ifeq ($(wildcard $(GNU_BIN)/$(CMPLR_PREFIX)munch$(HOSTEXE)),) #tornado2 export WIND_BASE = $(VX_DIR) diff --git a/src/iocsh/iocUtil.c b/src/iocsh/iocUtil.c index 7241bc7b5..6f1b7429c 100644 --- a/src/iocsh/iocUtil.c +++ b/src/iocsh/iocUtil.c @@ -28,7 +28,7 @@ static void runScriptCallFunc(ioccrfArg **args) } /* chdir */ -static ioccrfArg chdirArg0 = { "directory name",ioccrfArgString,0}; +static ioccrfArg chdirArg0 = { "current directory name",ioccrfArgString,0}; static ioccrfArg *chdirArgs[1] = {&chdirArg0}; static ioccrfFuncDef chdirFuncDef = {"cd",1,chdirArgs}; static void chdirCallFunc(ioccrfArg **args) @@ -36,6 +36,17 @@ static void chdirCallFunc(ioccrfArg **args) chdir((char *)args[0]->value); } +/* print current working directory */ +static ioccrfFuncDef pwdFuncDef = { "pwd", 0, 0 }; +static void pwdCallFunc (ioccrfArg **args) +{ + char buf[256]; + char *pwd = getcwd ( buf, sizeof(buf) - 1 ); + if ( pwd ) { + printf ( "%s\n", pwd ); + } +} + /* show (thread information) */ static ioccrfArg showArg0 = { "task",ioccrfArgString,0}; static ioccrfArg showArg1 = { "task",ioccrfArgString,0}; @@ -106,6 +117,7 @@ void epicsShareAPI iocUtilRegister(void) { ioccrfRegister(&runScriptFuncDef,runScriptCallFunc); ioccrfRegister(&chdirFuncDef,chdirCallFunc); + ioccrfRegister(&pwdFuncDef,pwdCallFunc); ioccrfRegister(&showFuncDef,showCallFunc); ioccrfRegister(&threadInitFuncDef,threadInitCallFunc); } diff --git a/src/iocsh/ioccrf.c b/src/iocsh/ioccrf.c index b1c1b5bde..12076992e 100644 --- a/src/iocsh/ioccrf.c +++ b/src/iocsh/ioccrf.c @@ -374,9 +374,12 @@ ioccrf (const char *pathname) pioccrfArg = pioccrfFuncDef->arg[arg]; if (!pargvalue) { pargvalue = callocMustSucceed(1, sizeof(argvalue), "ioccrf"); - if(prevargvalue) + if ( prevargvalue ) { prevargvalue->next = pargvalue; - argvalueHead = pargvalue; + } + else { + argvalueHead = pargvalue; + } } if (!cvtArg (filename, lineno, p, pargvalue, pioccrfArg)) break;