mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-16 23:49:28 +02:00
LazUtils: Masks: on Windows 'foo.*' should also match 'foo' (depends on quirks used). Patch by Jose Mejuto. Issue #39462.
This commit is contained in:
parent
2e7022648b
commit
7c0fdd1281
@ -1436,7 +1436,8 @@ begin
|
|||||||
|
|
||||||
// Quirk "blah.*" = "blah*"
|
// Quirk "blah.*" = "blah*"
|
||||||
if wqAnyExtension in fWindowsQuirkAllowed then begin
|
if wqAnyExtension in fWindowsQuirkAllowed then begin
|
||||||
if RightStr(lModifiedMask,3)='*.*' then begin
|
if (RightStr(lModifiedMask,2)='.*') and (Length(lModifiedMask)>2) then begin
|
||||||
|
//if RightStr(lModifiedMask,3)='*.*' then begin
|
||||||
lModifiedMask:=copy(lModifiedMask,1,Length(lModifiedMask)-2);
|
lModifiedMask:=copy(lModifiedMask,1,Length(lModifiedMask)-2);
|
||||||
fWindowsQuirkInUse:=fWindowsQuirkInUse+[wqAnyExtension];
|
fWindowsQuirkInUse:=fWindowsQuirkInUse+[wqAnyExtension];
|
||||||
end;
|
end;
|
||||||
@ -1499,7 +1500,15 @@ begin
|
|||||||
if wqNoExtension in fWindowsQuirkInUse then begin
|
if wqNoExtension in fWindowsQuirkInUse then begin
|
||||||
SplitFileNameExtension(aFileName,lFileName,lExtension,false);
|
SplitFileNameExtension(aFileName,lFileName,lExtension,false);
|
||||||
// wqNoExtension = Empty extension
|
// wqNoExtension = Empty extension
|
||||||
if lExtension<>'' then exit(false);
|
//if lExtension<>'' then exit(false);
|
||||||
|
// Its not clear if a file "file." should match an "*." mask because
|
||||||
|
// there is no way in Windows that a file ends with a dot.
|
||||||
|
if (lExtension<>'') and (lExtension<>'.') then
|
||||||
|
exit(false)
|
||||||
|
end else if wqAnyExtension in fWindowsQuirkInUse then begin
|
||||||
|
SplitFileNameExtension(aFileName,lFileName,lExtension,false);
|
||||||
|
Result:=inherited Matches(lFileName);
|
||||||
|
exit;
|
||||||
end;
|
end;
|
||||||
Result:=Inherited Matches(aFileName);
|
Result:=Inherited Matches(aFileName);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user