-----------------------
function Matches (S : String; P : String) return Boolean;
- -- Returns true if the String S patches the pattern P, which can contain
+ -- Returns true if the String S matches the pattern P, which can contain
-- wildcard chars (*). The entire pattern must match the entire string.
-- Case is ignored in the comparison (so X matches x).
if PPtr = PLast and then P (PPtr) = '*' then
return True;
- -- Return True if both pattern and string exhausted
+ -- Return True if both pattern and string exhausted
elsif PPtr > PLast and then SPtr > Slast then
return True;
- -- Return False, if one exhausted and not the other
+ -- Return False, if one exhausted and not the other
elsif PPtr > PLast or else SPtr > Slast then
return False;
- -- Case where pattern starts with asterisk
+ -- Case where pattern starts with asterisk
elsif P (PPtr) = '*' then
return False;
- -- Dealt with end of string and *, advance if we have a match
+ -- Dealt with end of string and *, advance if we have a match
elsif Fold_Lower (S (SPtr)) = Fold_Lower (P (PPtr)) then
SPtr := SPtr + 1;
PPtr := PPtr + 1;
- -- If first characters do not match, that's decisive
+ -- If first characters do not match, that's decisive
else
return False;