gvfs r1484 - in trunk: . client



Author: otte
Date: Sun Mar  2 18:12:07 2008
New Revision: 1484
URL: http://svn.gnome.org/viewvc/gvfs?rev=1484&view=rev

Log:
2008-03-02  Benjamin Otte  <otte gnome org>

	* client/gvfsuriutils.c: (g_vfs_decode_uri):
	don't pass the [] when parsing IPv6 addresses



Modified:
   trunk/ChangeLog
   trunk/client/gvfsuriutils.c

Modified: trunk/client/gvfsuriutils.c
==============================================================================
--- trunk/client/gvfsuriutils.c	(original)
+++ trunk/client/gvfsuriutils.c	Sun Mar  2 18:12:07 2008
@@ -181,23 +181,25 @@
 	      return NULL;
 	    }
 	  port_start = memchr (host_end, ':', authority_end - host_start);
+	  host_start++;
         }
       else
         {
 	  port_start = memchr (host_start, ':', authority_end - host_start);
+	  host_end = port_start ? port_start : authority_end;
 	}
 
       if (port_start)
 	{
-	  host_end = port_start++;
-
-	  decoded->port = atoi(port_start);
+	  decoded->port = atoi(port_start + 1);
+	  if (decoded->port <= 0)
+	    {
+	      g_vfs_decoded_uri_free (decoded);
+	      return NULL;
+	    }
 	}
       else
-	{
-	  host_end = authority_end;
-	  decoded->port = -1;
-	}
+	decoded->port = -1;
 
       decoded->host = g_strndup (host_start, host_end - host_start);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]