diff --git a/src/driver/toks_driver_ctx.c b/src/driver/toks_driver_ctx.c index 92c7a15..de6e05e 100644 --- a/src/driver/toks_driver_ctx.c +++ b/src/driver/toks_driver_ctx.c @@ -484,7 +484,15 @@ int toks_get_driver_ctx( return toks_get_driver_ctx_fail(meta); } - if ((cctx.drvflags & TOKS_DRIVER_MODE_SERVER) && (ntokens <= 0)) { + if ((ntokens == 0) && !(cctx.drvflags & TOKS_DRIVER_VERSION)) { + ntokens = (-1); + } + + if (ntokens == 0) { + cctx.drvflags &= ~(uint64_t)TOKS_DRIVER_MODE_SERVER; + } + + if ((cctx.drvflags & TOKS_DRIVER_MODE_SERVER) && (ntokens < 0)) { if (flags & TOKS_DRIVER_VERBOSITY_ERRORS) toks_dprintf(STDERR_FILENO, "%s: error: number of tokens not set or is invalid.",