mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-25 21:07:24 +01: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;
|
lFileNameMask: String;
|
||||||
lExtensionMask: String;
|
lExtensionMask: String;
|
||||||
lModifiedMask: String;
|
lModifiedMask: String;
|
||||||
|
ZeroPos: SizeInt;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
lModifiedMask:=fWindowsMask;
|
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*"
|
// Quirk "blah.*" = "blah*"
|
||||||
if wqAnyExtension in fWindowsQuirkAllowed then begin
|
if wqAnyExtension in fWindowsQuirkAllowed then begin
|
||||||
if RightStr(lModifiedMask,3)='*.*' then begin
|
if RightStr(lModifiedMask,3)='*.*' then begin
|
||||||
@ -1448,7 +1454,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
}
|
|
||||||
// Quirk "file???.ab?" matches "file1.ab1" and "file123.ab"
|
// Quirk "file???.ab?" matches "file1.ab1" and "file123.ab"
|
||||||
if wqFilenameEnd in fWindowsQuirkAllowed then begin
|
if wqFilenameEnd in fWindowsQuirkAllowed then begin
|
||||||
lFileNameMask:=OptionalQMarksAtEnd(lFileNameMask);
|
lFileNameMask:=OptionalQMarksAtEnd(lFileNameMask);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user