Skip to content

Commit 700c035

Browse files
committed
enable imap-options automatically with libcurl 8.19.0+
libcurl 8.19.0 supports all URL schemes even when the protocol itself is disabled. Refs: curl/curl@8edc033 curl/curl#20351
1 parent e77bd22 commit 700c035

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

trurl.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,17 @@ TRURL_NORETURN static void show_version(void)
285285
bool supports_puny = (data->features & CURL_VERSION_IDN) != 0;
286286
#endif
287287
#ifdef SUPPORTS_IMAP_OPTIONS
288-
bool supports_imap = false;
288+
bool supports_imap;
289+
#if CURL_AT_LEAST_VERSION(8,19,0)
290+
supports_imap = true;
291+
#else
289292
const char * const *protocol_name = data->protocols;
293+
supports_imap = false;
290294
while(*protocol_name && !supports_imap) {
291295
supports_imap = !strncmp(*protocol_name, "imap", 3);
292296
protocol_name++;
293297
}
298+
#endif
294299
#endif
295300

296301
fprintf(stdout, "%s version %s libcurl/%s [built-with %s]\n",

0 commit comments

Comments
 (0)