From ba746dcb1b551f92c6cd22a721de11a2d9b8869f Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Sun, 29 Sep 2024 16:28:57 +0100 Subject: [PATCH] tools/check_curl_symbols.py: fix CURLOPT handling The curl option handling seems to be non-functional since it suffers from two distinct issues. The regular expression tries to match options that we're not interested in and the symbol name is lacking the proper prefix. Adjust to match only on what we need and construct the name appropriately... Fix the issues flagged by the updated script. Signed-off-by: Emil Velikov --- src/core/core-url.c | 6 +++--- tools/check_curl_symbols.py | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/core/core-url.c b/src/core/core-url.c index d61eacf67..b51694aba 100644 --- a/src/core/core-url.c +++ b/src/core/core-url.c @@ -431,7 +431,7 @@ struct t_url_option url_options[] = URL_DEF_OPTION(HEADER, LONG, NULL), URL_DEF_OPTION(NOPROGRESS, LONG, NULL), #endif - #if LIBCURL_VERSION_NUM >= 0x070A00 /* 7.10.0 */ +#if LIBCURL_VERSION_NUM >= 0x070A00 /* 7.10.0 */ URL_DEF_OPTION(NOSIGNAL, LONG, NULL), #endif #if LIBCURL_VERSION_NUM >= 0x071500 /* 7.21.0 */ @@ -674,7 +674,7 @@ struct t_url_option url_options[] = #if LIBCURL_VERSION_NUM >= 0x071900 /* 7.25.0 */ URL_DEF_OPTION(MAIL_AUTH, STRING, NULL), #endif -#if LIBCURL_VERSION_NUM >= 0x074500 /* 7.69.0 */ +#if LIBCURL_VERSION_NUM >= 0x074500 && LIBCURL_VERSION_NUM < 0x080200 /* 7.69.0 < 8.2.0 */ URL_DEF_OPTION(MAIL_RCPT_ALLLOWFAILS, LONG, NULL), #endif @@ -823,7 +823,7 @@ struct t_url_option url_options[] = #if LIBCURL_VERSION_NUM >= 0x074100 /* 7.65.0 */ URL_DEF_OPTION(MAXAGE_CONN, LONG, NULL), #endif -#if LIBCURL_VERSION_NUM >= 0x071003 /* 7.16.3 */ +#if LIBCURL_VERSION_NUM >= 0x070700 /* 7.7.0 */ URL_DEF_OPTION(MAXCONNECTS, LONG, NULL), #endif #if LIBCURL_VERSION_NUM >= 0x071100 /* 7.17.0 */ diff --git a/tools/check_curl_symbols.py b/tools/check_curl_symbols.py index 86a790475..8a81bb893 100755 --- a/tools/check_curl_symbols.py +++ b/tools/check_curl_symbols.py @@ -66,8 +66,7 @@ WEECHAT_CURL_CONSTANT_RE = ( r" URL_DEF_CONST\((?P[A-Z0-9_]+), (?P[A-Z0-9_]+)\)," ) WEECHAT_CURL_OPTION_RE = ( - r" URL_DEF_OPTION\((?P[A-Z0-9_]+), (?P[A-Z]+)\), " - r"(?P[A-Za-z0-9_]+)\)," + r" URL_DEF_OPTION\((?P[A-Z0-9_]+), .*\)," ) CURL_SYMBOL_RE = r"[A-Z][A-Z0-9_]" @@ -215,9 +214,8 @@ def get_weechat_curl_symbols() -> Tuple[List[WeechatCurlSymbol], int]: # Curl option match = re.match(option_pattern, line) if match: - symbols.append( - WeechatCurlSymbol(match["name"], v_min, v_max, line_no) - ) + name = f"CURLOPT_{match['name']}" + symbols.append(WeechatCurlSymbol(name, v_min, v_max, line_no)) continue return symbols, errors