--- src.bak/url.c	Tue Jul 23 16:35:22 2002
+++ src/url.c	Tue Jul 23 16:48:43 2002
@@ -352,15 +352,20 @@
   const char *p1;
   char *newstr, *p2;
   int oldlen, newlen;
+  int copymethod;
 
   int encode_count = 0;
   int decode_count = 0;
+  int host_state = 0;
 
   /* First, pass through the string to see if there's anything to do,
      and to calculate the new length.  */
   for (p1 = s; *p1; p1++)
     {
-      switch (decide_copy_method (p1))
+	  if(*p1 == '/') host_state++;
+	  copymethod = decide_copy_method(p1);
+	  if(host_state == 2) copymethod = CM_PASSTHROUGH;
+      switch (copymethod)
 	{
 	case CM_ENCODE:
 	  ++encode_count;
@@ -375,7 +380,7 @@
 
   if (!encode_count && !decode_count)
     /* The string is good as it is. */
-    return (char *)s;		/* C const model sucks. */
+    return (char *)s;		/* C const model ****s (child friendly comment). */
 
   oldlen = p1 - s;
   /* Each encoding adds two characters (hex digits), while each
@@ -385,10 +390,14 @@
 
   p1 = s;
   p2 = newstr;
+  host_state = 0;
 
   while (*p1)
     {
-      switch (decide_copy_method (p1))
+	  if(*p1 == '/') host_state++;
+	  copymethod = decide_copy_method(p1);
+	  if(host_state == 2) copymethod = CM_PASSTHROUGH;
+      switch (copymethod)
 	{
 	case CM_ENCODE:
 	  {
@@ -409,6 +418,7 @@
     }
   *p2 = '\0';
   assert (p2 - newstr == newlen);
+
   return newstr;
 }
 
