diff --git a/components/lazutils/masks.pas b/components/lazutils/masks.pas index 77d14d1f4a..7c3a6fe466 100644 --- a/components/lazutils/masks.pas +++ b/components/lazutils/masks.pas @@ -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);