mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: Can't delete to the trash bin in symlinked directories on different partitions (fixes #2770)
(cherry picked from commit6199cb56f8) (cherry picked from commite608cef4bf)
This commit is contained in:
parent
92fda34fe5
commit
772ba4ab07
1 changed files with 6 additions and 7 deletions
|
|
@ -286,13 +286,11 @@ function fnmatch(const pattern: PAnsiChar; const str: PAnsiChar; flags: cint): c
|
|||
implementation
|
||||
|
||||
uses
|
||||
Unix, DCConvertEncoding, LazUTF8
|
||||
Unix, DCConvertEncoding, DCOSUtils, LazUTF8
|
||||
{$IF DEFINED(DARWIN)}
|
||||
, DCDarwin
|
||||
{$ELSEIF DEFINED(LINUX)}
|
||||
, Dos, DCLinux, DCOSUtils
|
||||
{$ELSEIF DEFINED(FREEBSD)}
|
||||
, DCOSUtils
|
||||
, Dos, DCLinux
|
||||
{$ENDIF}
|
||||
;
|
||||
|
||||
|
|
@ -495,21 +493,22 @@ begin
|
|||
begin
|
||||
if (I = 1) then
|
||||
sTemp:= PathDelim
|
||||
else
|
||||
else begin
|
||||
sTemp:= Copy(FileName, 1, I - 1);
|
||||
end;
|
||||
// Stat for current directory
|
||||
if (fpLStat(sTemp, recStat) < 0) then Continue;
|
||||
// If it is a link then checking link destination
|
||||
if fpS_ISLNK(recStat.st_mode) then
|
||||
begin
|
||||
sTemp:= fpReadlink(sTemp);
|
||||
sTemp:= mbReadAllLinks(sTemp);
|
||||
Result:= FindMountPointPath(sTemp);
|
||||
Exit;
|
||||
end;
|
||||
// Check device ID
|
||||
if (recStat.st_dev <> st_dev) then
|
||||
begin
|
||||
Result:= Copy(FileName, 1, J);
|
||||
Result:= IncludeTrailingPathDelimiter(Copy(FileName, 1, J));
|
||||
Exit;
|
||||
end;
|
||||
J:= I;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue