summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/driver/ntux_driver_ctx.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/driver/ntux_driver_ctx.c b/src/driver/ntux_driver_ctx.c
index 243a729..9443ab5 100644
--- a/src/driver/ntux_driver_ctx.c
+++ b/src/driver/ntux_driver_ctx.c
@@ -302,7 +302,20 @@ int ntux_get_driver_ctx(
optv,0,cctx.cmd);
/* initial argv scan: ... --cmd=xxx ... */
- for (parg=argv, cmdargv=0; *parg && !cmdargv; parg++) {
+ argv_scan(argv,optv,&ctx,0);
+
+ /* invalid ntux arguments? */
+ if (ctx.erridx && !ctx.unitidx) {
+ if (flags & NTUX_DRIVER_VERBOSITY_ERRORS)
+ argv_get(
+ argv,optv,
+ ARGV_VERBOSITY_ERRORS,
+ fdctx->fderr);
+ return -1;
+ }
+
+ /* scan for --cmd */
+ for (parg=argv, cmdargv=0; (parg<&argv[ctx.unitidx]) && !cmdargv; parg++) {
if (!strcmp(*parg,"--cmd") && parg[1]) {
cmdargv = &parg[2];
cmdmark = parg[2];