mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-27 02:42:04 +01:00
chmhelp: Add resource protection block to TIpChmDataProvider.BuildURL
git-svn-id: trunk@56129 -
This commit is contained in:
parent
faa58c53b1
commit
11aad71dab
@ -195,36 +195,39 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
ParentDirs := GetDirsParents(OldURL);
|
ParentDirs := GetDirsParents(OldURL);
|
||||||
RemoveDirCount := 0;
|
try
|
||||||
repeat
|
RemoveDirCount := 0;
|
||||||
X := Pos('../', fNewURL);
|
repeat
|
||||||
if X > 0 then
|
X := Pos('../', fNewURL);
|
||||||
begin
|
if X > 0 then
|
||||||
Delete(fNewURL, X, 3);
|
begin
|
||||||
Inc(RemoveDirCount);
|
Delete(fNewURL, X, 3);
|
||||||
end;
|
Inc(RemoveDirCount);
|
||||||
until X = 0;
|
end;
|
||||||
|
until X = 0;
|
||||||
|
|
||||||
repeat
|
repeat
|
||||||
X := Pos('./', fNewURL);
|
X := Pos('./', fNewURL);
|
||||||
if X > 0 then
|
if X > 0 then
|
||||||
Delete(fNewURL, X, 2);
|
Delete(fNewURL, X, 2);
|
||||||
until X = 0;
|
until X = 0;
|
||||||
|
|
||||||
Result := '';
|
Result := '';
|
||||||
for X := 0 to ParentDirs.Count-RemoveDirCount-1 do
|
for X := 0 to ParentDirs.Count-RemoveDirCount-1 do
|
||||||
Result := Result + ParentDirs[X] + '/';
|
Result := Result + ParentDirs[X] + '/';
|
||||||
|
|
||||||
Result := Result+fNewURL;
|
Result := Result+fNewURL;
|
||||||
|
|
||||||
repeat
|
repeat
|
||||||
X := Pos('//', Result);
|
X := Pos('//', Result);
|
||||||
if X > 0 then
|
if X > 0 then
|
||||||
Delete(Result, X, 1);
|
Delete(Result, X, 1);
|
||||||
until X = 0;
|
until X = 0;
|
||||||
|
|
||||||
ParentDirs.Free;
|
finally
|
||||||
//WriteLn('res = ', Result);
|
ParentDirs.Free;
|
||||||
|
//WriteLn('res = ', Result);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TIpChmDataProvider.GetDirsParents(ADir: String): TStringList;
|
function TIpChmDataProvider.GetDirsParents(ADir: String): TStringList;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user