]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
build: fix compiler warning with auths disabled
authorViktor Szakats <commit@vsz.me>
Sun, 29 Oct 2023 20:37:20 +0000 (20:37 +0000)
committerViktor Szakats <commit@vsz.me>
Mon, 30 Oct 2023 11:00:19 +0000 (11:00 +0000)
```
./curl/lib/http.c:979:12: warning: unused function 'is_valid_auth_separator' [-Wunused-function]
static int is_valid_auth_separator(char ch)
           ^
5 warnings generated.
```

Follow-up to e92edfbef64448ef461117769881f3ed776dec4e #11490

Closes #12227

lib/http.c

index d7e841fd9a034f383a07a4c55338d25142b5f967..eef7802013715d68a2ad675f29f05394b6196a8d 100644 (file)
@@ -970,17 +970,21 @@ Curl_http_output_auth(struct Curl_easy *data,
 }
 #endif
 
-/*
- * Curl_http_input_auth() deals with Proxy-Authenticate: and WWW-Authenticate:
- * headers. They are dealt with both in the transfer.c main loop and in the
- * proxy CONNECT loop.
- */
-
+#if defined(USE_SPNEGO) || defined(USE_NTLM) || \
+  !defined(CURL_DISABLE_DIGEST_AUTH) || \
+  !defined(CURL_DISABLE_BASIC_AUTH) || \
+  !defined(CURL_DISABLE_BEARER_AUTH)
 static int is_valid_auth_separator(char ch)
 {
   return ch == '\0' || ch == ',' || ISSPACE(ch);
 }
+#endif
 
+/*
+ * Curl_http_input_auth() deals with Proxy-Authenticate: and WWW-Authenticate:
+ * headers. They are dealt with both in the transfer.c main loop and in the
+ * proxy CONNECT loop.
+ */
 CURLcode Curl_http_input_auth(struct Curl_easy *data, bool proxy,
                               const char *auth) /* the first non-space */
 {