rpms/lynx/devel lynx-2.8.7-ipv6arg.patch, NONE, 1.1 lynx.spec, 1.64, 1.65
Kamil Dudka
kdudka at fedoraproject.org
Wed Apr 7 22:59:37 UTC 2010
Author: kdudka
Update of /cvs/extras/rpms/lynx/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv2269
Modified Files:
lynx.spec
Added Files:
lynx-2.8.7-ipv6arg.patch
Log Message:
- allow IPv6 addresses without http:// prefix (#425879)
lynx-2.8.7-ipv6arg.patch:
LYUtils.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
--- NEW FILE lynx-2.8.7-ipv6arg.patch ---
diff --git a/src/LYUtils.c b/src/LYUtils.c
index dd0a3dc..62a0591 100644
--- a/src/LYUtils.c
+++ b/src/LYUtils.c
@@ -2283,9 +2283,10 @@ UrlTypes is_url(char *filename)
return (result);
/*
- * Can't be a URL if it lacks a colon.
+ * Can't be a URL if it lacks a colon and if it starts with '[' it's
+ * probably IPv6 adress.
*/
- if (NULL == strchr(cp, ':'))
+ if (NULL == strchr(cp, ':') || cp[0] == '[')
return (result);
/*
@@ -4549,6 +4550,8 @@ BOOLEAN LYExpandHostForURL(char **AllocatedString,
#ifdef INET6
struct addrinfo hints, *res;
int error;
+ char *begin;
+ char *end = NULL;
#endif /* INET6 */
/*
@@ -4593,7 +4596,7 @@ BOOLEAN LYExpandHostForURL(char **AllocatedString,
* field after filling in the host field. - FM
*/
if ((StrColon = strrchr(Str, ':')) != NULL &&
- isdigit(UCH(StrColon[1]))) {
+ isdigit(UCH(StrColon[1])) && strchr(StrColon, ']') == NULL) {
if (StrColon == Str) {
goto cleanup;
}
@@ -4614,10 +4617,20 @@ BOOLEAN LYExpandHostForURL(char **AllocatedString,
fprintf(stdout, "%s '%s'%s\r\n", WWW_FIND_MESSAGE, host, FIRST_SEGMENT);
}
#ifdef INET6
+ begin = host;
+ if (host[0] == '[' && ((end = strrchr(host, ']')))) {
+ /*
+ * cut '[' and ']' from the IPv6 address, e.g. [::1]
+ */
+ begin = host + 1;
+ *end = '\0';
+ }
memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
- error = getaddrinfo(host, "80", &hints, &res);
+ error = getaddrinfo(begin, "80", &hints, &res);
+ if (end)
+ *end = ']';
if (!error && res)
#else
Index: lynx.spec
===================================================================
RCS file: /cvs/extras/rpms/lynx/devel/lynx.spec,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -p -r1.64 -r1.65
--- lynx.spec 7 Apr 2010 12:50:17 -0000 1.64
+++ lynx.spec 7 Apr 2010 22:59:36 -0000 1.65
@@ -1,7 +1,7 @@
Summary: A text-based Web browser
Name: lynx
Version: 2.8.7
-Release: 3%{?dist}
+Release: 4%{?dist}
License: GPLv2
Group: Applications/Internet
Source: http://lynx.isc.org/lynx%{version}/lynx%{version}.tar.bz2
@@ -30,6 +30,9 @@ Patch4: lynx-2.8.7-bm-del.patch
# avoid build failure caused by mistakenly excluded <locale.h>
Patch5: lynx-2.8.7-locale.patch
+# bz #425879
+Patch6: lynx-2.8.7-ipv6arg.patch
+
Provides: webclient
Provides: text-www-browser
BuildRequires: gettext
@@ -58,6 +61,7 @@ exits quickly and swiftly displays web p
%patch3 -p1
%patch4 -p1
%patch5 -p1
+%patch6 -p1
perl -pi -e "s,^HELPFILE:.*,HELPFILE:file://localhost/usr/share/doc/lynx-%{version}/lynx_help/lynx_help_main.html,g" lynx.cfg
perl -pi -e "s,^DEFAULT_INDEX_FILE:.*,DEFAULT_INDEX_FILE:http://www.google.com/,g" lynx.cfg
@@ -145,6 +149,9 @@ rm -rf $RPM_BUILD_ROOT
%config(noreplace,missingok) %{_sysconfdir}/lynx-site.cfg
%changelog
+* Thu Apr 08 2010 Kamil Dudka <kdudka at redhat.com> - 2.8.7-4
+- allow IPv6 addresses without http:// prefix (#425879)
+
* Wed Apr 07 2010 Kamil Dudka <kdudka at redhat.com> - 2.8.7-3
- avoid build failure caused by mistakenly excluded <locale.h>
More information about the scm-commits
mailing list