diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2009-04-07 17:16:34 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2009-04-07 17:16:34 +0200 |
commit | 06a16f58d6c14487c0598fe6f1c5cd68ba68301e (patch) | |
tree | 685318c0693ad3631679e215c9ae5764d0035d01 /gcc/ada/s-regexp.adb | |
parent | df46b832b04ae500284492241a71854b434aec37 (diff) | |
download | gcc-06a16f58d6c14487c0598fe6f1c5cd68ba68301e.zip gcc-06a16f58d6c14487c0598fe6f1c5cd68ba68301e.tar.gz gcc-06a16f58d6c14487c0598fe6f1c5cd68ba68301e.tar.bz2 |
[multiple changes]
2009-04-07 Emmanuel Briot <briot@adacore.com>
* s-regexp.adb (Create_Mapping): Ignore excaped open parenthesis when
looking for the end of a parenthesis group
2009-04-07 Tristan Gingold <gingold@adacore.com>
* gsocket.h Don't #include resolvLib.h if __RTP__ is defined.
* socket.c Don't use resolvLib_ macros if not defined.
From-SVN: r145680
Diffstat (limited to 'gcc/ada/s-regexp.adb')
-rwxr-xr-x | gcc/ada/s-regexp.adb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/ada/s-regexp.adb b/gcc/ada/s-regexp.adb index 268ec21..37c189a 100755 --- a/gcc/ada/s-regexp.adb +++ b/gcc/ada/s-regexp.adb @@ -32,7 +32,6 @@ ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; --- with Ada.Exceptions; with System.Case_Util; @@ -205,6 +204,7 @@ package body System.Regexp is J : Integer := S'First; Parenthesis_Level : Integer := 0; Curly_Level : Integer := 0; + Last_Open : Integer := S'First - 1; -- Start of processing for Create_Mapping @@ -282,6 +282,7 @@ package body System.Regexp is when Open_Paren => if not Glob then Parenthesis_Level := Parenthesis_Level + 1; + Last_Open := J; else Add_In_Map (Open_Paren); end if; @@ -296,7 +297,7 @@ package body System.Regexp is & "expression", J); end if; - if S (J - 1) = Open_Paren then + if J = Last_Open + 1 then Raise_Exception ("Empty parenthesis not allowed in regular " & "expression", J); |