Browse Source

+ Fixed wrong handling of hostname (again)

michael 22 years ago
parent
commit
adc773adcf
1 changed files with 4 additions and 2 deletions
  1. 4 2
      packages/base/netdb/uriparser.pp

+ 4 - 2
packages/base/netdb/uriparser.pp

@@ -194,7 +194,9 @@ begin
 
 
   LastValidPos := 0;
   LastValidPos := 0;
   for i := Length(s) downto 1 do
   for i := Length(s) downto 1 do
-    if s[i] = '/' then
+    if (s[i] = '/')
+       and ((I>1) and (S[i-1]<>'/')) 
+       and ((I<Length(S)) and (S[I+1]<>'/')) then
       LastValidPos := i
       LastValidPos := i
     else if s[i] in [':', '@'] then
     else if s[i] in [':', '@'] then
       break;
       break;
@@ -245,7 +247,7 @@ begin
 	Result.Password := Copy(s, i + 1, Length(s));
 	Result.Password := Copy(s, i + 1, Length(s));
       end;
       end;
     end;
     end;
-  end;
+  end; 
 end;
 end;
 
 
 end.
 end.