]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl: make -N handled correctly
authorDaniel Stenberg <daniel@haxx.se>
Tue, 3 Jun 2025 11:34:08 +0000 (13:34 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 3 Jun 2025 14:51:00 +0000 (16:51 +0200)
Options marked ARG_NO should have their 'toggle' value reverted when the
short option is used as it implies using the --no- prefix.

-N happens be the only short option flag for a --no- long option.

Reported-by: Stefan Eissing
Closes #17527

src/tool_getparam.c

index f09a594c05f6f5177a6fd0f02084bc75f28b5b9e..51156e46b97e19b3f97c116c362740a36660ebeb 100644 (file)
@@ -2881,6 +2881,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
         err = PARAM_OPTION_UNKNOWN;
         break;
       }
+      toggle = !(a->desc & ARG_NO);
     }
     if((a->desc & ARG_TLS) && !feature_ssl) {
       err = PARAM_LIBCURL_DOESNT_SUPPORT;