Re: [tin-dev] [tin 2.6.5] snapshots
In Urs Janßen <urs@tin.org> wrote:
New Snapshots available.
if build with libcurl or liburiparser news-urls are no longer recognized (as none of the libs does support them), this should fix the issue: === modified file 'src/cook.c' --- old/src/cook.c 2025-07-31 07:07:00 +0000 +++ new/src/cook.c 2025-08-08 10:48:18 +0000 @@ -1862,22 +1862,21 @@ /* find and validate URIs */ CHECK_URI(url_regex, C_URL); CHECK_URI(mail_regex, C_MAIL); - CHECK_URI(news_regex, C_NEWS); #else # ifdef HAVE_LIBCURL /* find and validate URIs */ CHECK_URI(url_regex, C_URL); CHECK_URI(mail_regex, C_MAIL); - CHECK_URI(news_regex, C_NEWS); # else if (MATCH_REGEX(url_regex, line, len)) flags |= C_URL; if (MATCH_REGEX(mail_regex, line, len)) flags |= C_MAIL; +# endif /* HAVE_LIBCURL */ +#endif /* HAVE_LIBURIPARSER */ + /* see debian bug #687198 */ if (MATCH_REGEX(news_regex, line, len)) flags |= C_NEWS; -# endif /* HAVE_LIBCURL */ -#endif /* HAVE_LIBURIPARSER */ if (expand_ctrl_chars(&line, &max_line_len, tabwidth)) flags |= C_CTRLL; /* Line contains form-feed */ === modified file 'src/page.c' --- old/src/page.c 2025-07-10 19:11:06 +0000 +++ new/src/page.c 2025-08-10 11:45:36 +0000 @@ -2695,52 +2695,54 @@ return FALSE; } -#ifdef HAVE_LIBURIPARSER - /* - * Syntax-Based Normalization RFC 3986 6.2.2 - * - * We could keep the error code, but that would be likely - * always URI_ERROR_SYNTAX, so no big win. - * With -DDEBUG MISC|URI we would write some details - * (uri.scheme, uri.hostText, ...) to a log. - * And/or make use of uri(Une|E)scape* ... - */ - state.uri = &uri; - if (uriParseUriA(&state, url) == URI_SUCCESS) { - if (uriNormalizeSyntaxA(&uri) == URI_SUCCESS) { - if (uriToStringCharsRequiredA(&uri, &ulen) == URI_SUCCESS) { - uri_norm = my_malloc(++ulen); - if (uriToStringA(uri_norm, &uri, ulen, NULL) == URI_SUCCESS) { +#if defined(HAVE_LIBURIPARSER) || defined(HAVE_LIBCURL) + if (!(MATCH_REGEX(news_regex, url, strlen(url)))) { /* normalize all but news */ +# ifdef HAVE_LIBURIPARSER + /* + * Syntax-Based Normalization RFC 3986 6.2.2 + * + * We could keep the error code, but that would be likely + * always URI_ERROR_SYNTAX, so no big win. + * With -DDEBUG MISC|URI we would write some details + * (uri.scheme, uri.hostText, ...) to a log. + * And/or make use of uri(Une|E)scape* ... + */ + state.uri = &uri; + if (uriParseUriA(&state, url) == URI_SUCCESS) { + if (uriNormalizeSyntaxA(&uri) == URI_SUCCESS) { + if (uriToStringCharsRequiredA(&uri, &ulen) == URI_SUCCESS) { + uri_norm = my_malloc(++ulen); + if (uriToStringA(uri_norm, &uri, ulen, NULL) == URI_SUCCESS) { + free(url); + url = uri_norm; + } else { + free(uri_norm); + ulen = -1; + } + } + } + uriFreeUriMembersA(&uri); + } +# else +# ifdef HAVE_LIBCURL + /* same as above but with libcurl, again no detailed error logging yet */ + if ((curl = curl_url())) { + if (curl_url_set(curl, CURLUPART_URL, url, CURLU_URLENCODE) == CURLUE_OK) { + if (curl_url_get(curl, CURLUPART_URL, &uri_norm, 0) == CURLUE_OK) { free(url); url = uri_norm; - } else { - free(uri_norm); - ulen = -1; + ulen = strlen(url); } } - } - uriFreeUriMembersA(&uri); - } -#else -# ifdef HAVE_LIBCURL - /* same as above but with libcurl, again no detailed error logging yet */ - if ((curl = curl_url())) { - if (curl_url_set(curl, CURLUPART_URL, url, CURLU_URLENCODE) == CURLUE_OK) { - if (curl_url_get(curl, CURLUPART_URL, &uri_norm, 0) == CURLUE_OK) { - free(url); - url = uri_norm; - ulen = strlen(url); - } - } - curl_url_cleanup(curl); - } -# endif /* HAVE_LIBCURL */ -#endif /* HAVE_LIBURIPARSER */ -#if defined(HAVE_LIBURIPARSER) || defined(HAVE_LIBCURL) - if (ulen < 0) { /* should only happen if the URL was modified in the prompt above */ - error_message(2, "URI Normalization failed: %s", url); /* TODO: -> lang.c; _()? */ - free(url); - return FALSE; + curl_url_cleanup(curl); + } +# endif /* HAVE_LIBCURL */ +# endif /* HAVE_LIBURIPARSER */ + if (ulen < 0) { /* should only happen if the URL was modified in the prompt above */ + error_message(2, "URI Normalization failed: %s", url); /* TODO: -> lang.c; _()? */ + free(url); + return FALSE; + } } #endif /* HAVE_LIBURIPARSER || HAVE_LIBCURL */ url_esc = escape_shell_meta(url, no_quote);
participants (1)
-
Urs Janßen