s-regpat.adb (Parse_Character_Class): Fix handling of empty character classes ("[]").

2007-09-10  Emmanuel Briot  <briot@adacore.com>

	* s-regpat.adb (Parse_Character_Class): Fix handling of empty character
	classes ("[]").

From-SVN: r128333
This commit is contained in:
Emmanuel Briot 2007-09-10 14:47:36 +02:00 committed by Arnaud Charlet
parent b5c84c3ccf
commit 36df551d43

View File

@ -1457,6 +1457,10 @@ package body System.Regpat is
elsif not In_Range then
Last_Value := Value;
if Parse_Pos > Expression'Last then
Fail ("Empty character class []");
end if;
if Expression (Parse_Pos) = '-'
and then Parse_Pos < Parse_End
and then Expression (Parse_Pos + 1) /= ']'