mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 13:59:31 +02:00
LazUtils: Masks: disallow #0 in the user supplied mask for TWindowsMask.
Note: code contains writeln's, so it will crash if no console is available.
This commit is contained in:
parent
cd4ce74027
commit
aae437d605
@ -1408,10 +1408,16 @@ var
|
||||
lFileNameMask: String;
|
||||
lExtensionMask: String;
|
||||
lModifiedMask: String;
|
||||
ZeroPos: SizeInt;
|
||||
|
||||
begin
|
||||
lModifiedMask:=fWindowsMask;
|
||||
|
||||
//We cannot have #0 in the mask,since we use it internally
|
||||
ZeroPos:=Pos(#0, fWindowsMask);
|
||||
if ZeroPos>0 then
|
||||
Exception_InvalidCharMask('NullCharacter', ZeroPos);
|
||||
|
||||
// Quirk "blah.*" = "blah*"
|
||||
if wqAnyExtension in fWindowsQuirkAllowed then begin
|
||||
if RightStr(lModifiedMask,3)='*.*' then begin
|
||||
@ -1448,7 +1454,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
}
|
||||
|
||||
// Quirk "file???.ab?" matches "file1.ab1" and "file123.ab"
|
||||
if wqFilenameEnd in fWindowsQuirkAllowed then begin
|
||||
lFileNameMask:=OptionalQMarksAtEnd(lFileNameMask);
|
||||
|
Loading…
Reference in New Issue
Block a user