about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--CHANGES6
-rw-r--r--src/LYUtils.c23
-rw-r--r--src/makefile.in4
3 files changed, 24 insertions, 9 deletions
diff --git a/CHANGES b/CHANGES
index aabe9f72..af442b91 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,9 +1,11 @@
--- $LynxId: CHANGES,v 1.467 2010/03/28 21:02:11 tom Exp $
+-- $LynxId: CHANGES,v 1.468 2010/04/07 22:56:00 tom Exp $
 ===============================================================================
 Changes since Lynx 2.8 release
 ===============================================================================
 
-2010-03-28 (2.8.8dev.3)
+2010-04-07 (2.8.8dev.3)
+* allow IPv6 addresses without "http://" prefix (Redhat #425879, patch by Kamil
+  Dudka)
 * build-fixes for OpenSolaris aka Solaris 11 -TD
 * add/use CF_RPATH_HACK, for constructing rpath references to libraries in
   nonstandard locations -TD
diff --git a/src/LYUtils.c b/src/LYUtils.c
index e4439c73..a7b73cf5 100644
--- a/src/LYUtils.c
+++ b/src/LYUtils.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYUtils.c,v 1.193 2009/11/22 22:30:06 tom Exp $
+ * $LynxId: LYUtils.c,v 1.194 2010/04/07 22:26:15 Kamil.Dudka Exp $
  */
 #include <HTUtils.h>
 #include <HTTCP.h>
@@ -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);
 
     /*
@@ -4548,6 +4549,8 @@ BOOLEAN LYExpandHostForURL(char **AllocatedString,
 #ifdef INET6
     struct addrinfo hints, *res;
     int error;
+    char *begin;
+    char *end = NULL;
 #endif /* INET6 */
 
     /*
@@ -4592,7 +4595,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;
 	}
@@ -4613,10 +4616,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
diff --git a/src/makefile.in b/src/makefile.in
index 60c1f1ef..b6c1db2f 100644
--- a/src/makefile.in
+++ b/src/makefile.in
@@ -1,4 +1,4 @@
-# $LynxId: makefile.in,v 1.60 2010/01/22 10:28:46 tom Exp $
+# $LynxId: makefile.in,v 1.61 2010/04/04 22:56:11 tom Exp $
 # template-makefile for Lynx src directory
 
 SHELL		= @CONFIG_SHELL@
@@ -37,7 +37,7 @@ BUILD_EXEEXT	= @BUILD_EXEEXT@
 YACC		= @YACC@
 
 LIBS		= @LIBS@ $(RESOLVLIB) $(WAISLIB) $(SITE_LIBS)
-LDFLAGS		= @LDFLAGS@
+LDFLAGS		= @EXTRA_LDFLAGS@ @LDFLAGS@
 
 # Symbols inherited from the top-level makefile
 RESOLVLIB	= # FIXME: set in parent makefile