mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 20:19:24 +02:00
LazUtils: use CompileAnyCharOrNone in TWindowsMaskUTF8.CompileOtherSpecialChars.
Fix not including wqFileNameEnd in fWindowsQuirksInUse. Note: code contains writeln's, so it will crash if no console is available.
This commit is contained in:
parent
ad69e5b56b
commit
905d99b813
@ -1383,24 +1383,7 @@ begin
|
|||||||
inherited CompileOtherSpecialChars;
|
inherited CompileOtherSpecialChars;
|
||||||
if (fMask[fMaskInd]=#0) and not (wqFileNameEnd in self.fWindowsQuirkInUse) then
|
if (fMask[fMaskInd]=#0) and not (wqFileNameEnd in self.fWindowsQuirkInUse) then
|
||||||
Exception_InternalError;
|
Exception_InternalError;
|
||||||
ZeroCount:=1;
|
CompileAnyCharOrNone(#0, False);
|
||||||
while (fMaskInd+ZeroCount<=fMaskLimit) and (fMask[fMaskInd+ZeroCount]=#0) do Inc(ZeroCount);
|
|
||||||
//writeln('Nr of Zero''s: ',ZeroCount);
|
|
||||||
|
|
||||||
Add(TMaskParsedCode.CharsGroupBegin);
|
|
||||||
lCharsGroupInsertSize:=fMaskCompiledIndex;
|
|
||||||
Add(0);
|
|
||||||
Add(TMaskParsedCode.AnyCharOrNone);
|
|
||||||
Add(1);
|
|
||||||
if ZeroCount>1 then
|
|
||||||
IncrementLastCounterBy(TMaskParsedCode.AnyCharOrNone,ZeroCount-1);
|
|
||||||
PInteger(@fMaskCompiled[lCharsGroupInsertSize])^:=fMaskCompiledIndex;
|
|
||||||
Add(TMaskParsedCode.CharsGroupEnd);
|
|
||||||
fLastOC:=TMaskParsedCode.CharsGroupEnd;
|
|
||||||
Inc(fMatchMaximumLiteralBytes,ZeroCount*4);
|
|
||||||
Inc(fMaskInd,ZeroCount-1);
|
|
||||||
//write('fMaskInd=',fMaskInd,', fMaskLimit=',fMaskLimit,' fMask[fMaskInd]=');if fMaskInd<=fMaskLimit then writeln('#',Ord(fMask[fMaskInd]),': ',fMask[fMaskInd])else writeln('>>');
|
|
||||||
//writeln('CompileOtherSpecialChars end.');
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TWindowsMaskUTF8.IsSpecialChar(AChar: Char): Boolean;
|
function TWindowsMaskUTF8.IsSpecialChar(AChar: Char): Boolean;
|
||||||
@ -1536,6 +1519,8 @@ begin
|
|||||||
if wqFilenameEnd in fWindowsQuirkAllowed then begin
|
if wqFilenameEnd in fWindowsQuirkAllowed then begin
|
||||||
lFileNameMask:=OptionalQMarksAtEnd(lFileNameMask);
|
lFileNameMask:=OptionalQMarksAtEnd(lFileNameMask);
|
||||||
lExtensionMask:=OptionalQMarksAtEnd(lExtensionMask);
|
lExtensionMask:=OptionalQMarksAtEnd(lExtensionMask);
|
||||||
|
if (Pos(#0, lFileNameMask)>0) or (Pos(#0, lExtensionMask)>0) then
|
||||||
|
fWindowsQuirkInUse:=fWindowsQuirkInUse+[wqFilenameEnd];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if wqNoExtension in fWindowsQuirkAllowed then begin
|
if wqNoExtension in fWindowsQuirkAllowed then begin
|
||||||
|
Loading…
Reference in New Issue
Block a user