--- l2_ch_pipe.c 2001/09/26 12:10:31 1.18
+++ l2_ch_pipe.c 2001/09/26 14:29:03 1.19
@@ -104,7 +104,7 @@
l2_ch_pipe_t *cfg = (l2_ch_pipe_t *)ctx->vp;
l2_param_t pa[3];
l2_result_t rv;
- char *sz;
+ char *sz = NULL;
/* feed and call generic parameter parsing engine */
L2_PARAM_SET(pa[0], mode, CHARPTR, &sz);
@@ -113,14 +113,16 @@
if ((rv = l2_util_setparams(pa, fmt, ap)) != L2_OK)
return rv;
- if (strcmp(sz, "direct") == 0)
- cfg->iMode = L2_PIPE_MODEDIRECT;
- else if (strcmp(sz, "shell") == 0)
- cfg->iMode = L2_PIPE_MODESHELL;
- else
- return L2_ERR_ARG;
+ if (sz != NULL) {
+ if (strcmp(sz, "direct") == 0)
+ cfg->iMode = L2_PIPE_MODEDIRECT;
+ else if (strcmp(sz, "shell") == 0)
+ cfg->iMode = L2_PIPE_MODESHELL;
+ else
+ return L2_ERR_ARG;
+ }
- return rv;
+ return L2_OK;
}
/**********************************************************
@@ -157,6 +159,10 @@
l2_result_t rv;
char *sz = NULL;
+ /* consistency check */
+ if (cfg->szCmdpath == NULL)
+ return L2_ERR_USE;
+
/* initialize auto vars before using them */
memset(pVec, 0, sizeof(pVec));
memset(&locact, 0, sizeof(locact));
|