mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 09:19:14 +02:00
lazutils: ChompPathDelim: under windows: do not chomp UNC base path double slash
git-svn-id: trunk@34374 -
This commit is contained in:
parent
7b40b6ff7e
commit
77c557782e
@ -1404,7 +1404,7 @@ begin
|
||||
if DoReference then
|
||||
Result.Reference;
|
||||
end else if DoReference or CreateIfNotExists then begin
|
||||
Dir:=FindDiskFilename(ChompPathDelim(TrimFilename(Directory)));
|
||||
Dir:=FindDiskFilename(Directory);
|
||||
Result:=TCTDirectoryCache.Create(Dir,Self);
|
||||
FDirectories.Add(Result);
|
||||
if DoReference then
|
||||
|
@ -7,9 +7,13 @@ interface
|
||||
uses
|
||||
Classes, SysUtils, LazUTF8, LUResStrings;
|
||||
|
||||
{$if defined(Windows) or defined(darwin)}
|
||||
{$IFDEF Windows}
|
||||
{$define CaseInsensitiveFilenames}
|
||||
{$endif}
|
||||
{$define HasUNCPaths}
|
||||
{$ENDIF}
|
||||
{$IFDEF darwin}
|
||||
{$define CaseInsensitiveFilenames}
|
||||
{$ENDIF}
|
||||
{$IF defined(CaseInsensitiveFilenames) or defined(darwin)}
|
||||
{$DEFINE NotLiteralFilenames} // e.g. HFS+ normalizes file names
|
||||
{$ENDIF}
|
||||
@ -853,6 +857,10 @@ begin
|
||||
Result:=Path;
|
||||
Len:=length(Result);
|
||||
while (Len>1) and (Result[Len]=PathDelim) do dec(Len);
|
||||
{$IFDEF HasUNCPaths}
|
||||
if (Len=1) and (Result[1]=PathDelim) then
|
||||
Len:=2; // keep UNC '\\', chomp 'a\' to 'a'
|
||||
{$ENDIF}
|
||||
if Len<length(Result) then
|
||||
SetLength(Result,Len);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user