ShellCtrls: escape '[' in the mask in GetFilesInDir if a TMaskList is used (see comments).

git-svn-id: trunk@61844 -
This commit is contained in:
bart 2019-09-08 20:39:21 +00:00
parent 47072a2219
commit a9d197d902

View File

@ -689,6 +689,11 @@ begin
;
if UseMaskList then
begin
//"Escape" occurrences of '[', since TMaskList treats those as start of a set,
//this behaviour would be incompatible with the situation if no MaskList was used
//and it would break backwards compatibilty and could raise unexpected EConvertError where it did not in the past.
//If you need sets in the MaskList, use the OnAddItem event for that. (BB)
MaskStr := StringReplace(MaskStr, '[', '[[]', [rfReplaceAll]);
{$ifdef NotLiteralFilenames}
MaskList := TMaskList.Create(MaskStr, ';', (ACaseSensitivity = mcsCaseSensitive)); //False by default
{$else}