mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
(cherry picked from commit 273759d119)
This commit is contained in:
parent
5f6d47f553
commit
4e2506d9f2
2 changed files with 14 additions and 3 deletions
|
|
@ -396,11 +396,16 @@ const
|
|||
AllowPathDelimiters : set of char = ['\','/'];
|
||||
var
|
||||
I : LongInt;
|
||||
uriPos : Integer;
|
||||
begin
|
||||
Result:= Path;
|
||||
// If path is not URI
|
||||
if Pos('://', Result) = 0 then
|
||||
begin
|
||||
uriPos := Pos('://', Result);
|
||||
if (uriPos = 0)
|
||||
{$IF DEFINED(MSWINDOWS)}
|
||||
or ( (uriPos = 2) and (Path[1] in ['A'..'z']) )
|
||||
{$ENDIF} then
|
||||
begin
|
||||
for I:= 1 to Length(Path) do
|
||||
if Path[I] in AllowPathDelimiters then
|
||||
Result[I]:= DirectorySeparator;
|
||||
|
|
|
|||
|
|
@ -358,13 +358,19 @@ end;
|
|||
|
||||
function mbExpandFileName(const sFileName: String): String;
|
||||
begin
|
||||
if (Pos('://', sFileName) > 0) then
|
||||
if (Pos('://', sFileName) > 2) then
|
||||
Result:= sFileName
|
||||
else begin
|
||||
Result:= NormalizePathDelimiters(sFileName);
|
||||
Result:= ReplaceEnvVars(Result);
|
||||
if Pos(PathDelim, Result) <> 0 then
|
||||
Result:= ExpandFileName(Result);
|
||||
|
||||
{$IF DEFINED(MSWINDOWS)}
|
||||
// Remove double backslash '\\' after calling 'ExpandFileName'
|
||||
if (Pos(':\\', Result) = 2) and (Result[1] in ['A'..'z']) then
|
||||
Result:= Result.Remove(2, 1);
|
||||
{$ENDIF}
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue