From: Mark Andrews Date: Thu, 17 Oct 2024 01:03:22 +0000 (+1100) Subject: Restore seperator values X-Git-Tag: v9.21.3~70^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=609d96aa1283c362e5c03a157e747d218c70aa17;p=thirdparty%2Fbind9.git Restore seperator values strtok_r is destructive. Restore the seperators so that the command line can be properly displayed. --- diff --git a/bin/dig/dig.c b/bin/dig/dig.c index 288b327ef29..16b2de5e85e 100644 --- a/bin/dig/dig.c +++ b/bin/dig/dig.c @@ -1827,6 +1827,9 @@ plus_option(char *option, bool is_batchfile, bool *need_clone, extra = strtok_r(NULL, "\0", &last); save_opt(lookup, code, extra); + if (extra != NULL) { + extra[-1] = ':'; + } break; default: goto invalid_option; @@ -2555,6 +2558,9 @@ plus_option(char *option, bool is_batchfile, bool *need_clone, fprintf(stderr, "Invalid option: +%s\n", option); usage(); } + if (value != NULL) { + value[-1] = '='; + } return (lookup); #if !TARGET_OS_IPHONE @@ -2826,6 +2832,10 @@ dash_option(char *option, char *next, dig_lookup_t **lookup, /* XXXONDREJ: FIXME */ strlcpy(keynametext, ptr, sizeof(keynametext)); strlcpy(keysecret, ptr2, sizeof(keysecret)); + if (ptr3 != NULL) { + ptr[-1] = ':'; + } + ptr2[-1] = ':'; return (value_from_next); case 'x': if (*need_clone) {