mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 19:29:09 +02:00
* Fixed hostname parsing when the protocol and the leading "//" are missing
This commit is contained in:
parent
2698227d41
commit
5bd25ccc15
@ -2,8 +2,9 @@
|
|||||||
$Id$
|
$Id$
|
||||||
This file is part of the Free Pascal run time library.
|
This file is part of the Free Pascal run time library.
|
||||||
Copyright (c) 2003 by the Free Pascal development team
|
Copyright (c) 2003 by the Free Pascal development team
|
||||||
|
Original author: Sebastian Guenther
|
||||||
|
|
||||||
Unit to parse complete URI in its parts.
|
Unit to parse complete URI in its parts or to reassemble an URI
|
||||||
|
|
||||||
See the file COPYING.FPC, included in this distribution,
|
See the file COPYING.FPC, included in this distribution,
|
||||||
for details about the copyright.
|
for details about the copyright.
|
||||||
@ -219,8 +220,11 @@ begin
|
|||||||
|
|
||||||
// Extract the hostname
|
// Extract the hostname
|
||||||
|
|
||||||
if (Length(s) > 2) and (s[1] = '/') and (s[2] = '/') then
|
if ((Length(s) > 2) and (s[1] = '/') and (s[2] = '/')) or
|
||||||
|
((Length(s) > 1) and (s[1] <> '/')) then
|
||||||
begin
|
begin
|
||||||
|
if s[1] <> '/' then
|
||||||
|
s := '//' + s;
|
||||||
for i := Length(s) downto 1 do
|
for i := Length(s) downto 1 do
|
||||||
if s[i] in ['@', '/'] then
|
if s[i] in ['@', '/'] then
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user