File lynx-2.8.6-ipv6.patch of Package lynx

--- lynx2-8-6/WWW/Library/Implementation/HTParse.c	2005-10-17 02:17:20.000000000 +0200
+++ lynx2-8-6/WWW/Library/Implementation/HTParse.c	2006-09-18 16:00:10.000000000 +0200
@@ -86,6 +86,9 @@
 {
     char *after_access;
     char *p;
+#ifdef INET6
+    int ipv6 = 0;
+#endif /* INET6 */
 
     parts->access = NULL;
     parts->host = NULL;
@@ -99,6 +102,19 @@
      */
     after_access = name;
     for (p = name; *p; p++) {
+#ifdef INET6
+	if (ipv6 == 1 && (isxdigit(*p) || *p == ':')) /* skip IPv6 addr. */
+	    continue;
+	if (*p == '[') {  /* begin IPv6 addr. like: [fe00::0]:80 */
+	    ipv6=1;
+	    continue;
+	}
+	if (*p == ']' && ipv6) {  /* end IPv6 addr. */
+	    ipv6=0;
+	    continue;
+	}
+#endif /* INET6 */
+
 	if (*p == ':') {
 	    *p = '\0';
 	    parts->access = name;	/* Access name has been specified */
@@ -350,10 +366,32 @@
 	     */
 	    {
 		char *p2, *h;
+#ifdef INET6
+		int ipv6 = 0;
+#endif  /* INET6 */
 
 		if ((p2 = strchr(result, '@')) != NULL)
 		    tail = (p2 + 1);
+#ifdef INET6
+		for (p2=tail; *p2; p2++) {
+		   if (*p2 == '[') {
+			ipv6 = 1;
+			continue;
+		   }
+		   if (*p2 == ']' && ipv6) {
+			ipv6 = 0;
+			continue;
+		   }
+		   if (!ipv6 && *p2 == ':') {
+			break;
+		   }
+		}
+		if (*p2 != ':') {
+		   p2 = NULL;
+		}
+#else
 		p2 = strchr(tail, ':');
+#endif
 		if (p2 != NULL && !isdigit(UCH(p2[1])))
 		    /*
 		     * Colon not followed by a port number.
openSUSE Build Service is sponsored by