summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorkosako <kosako@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-03-23 12:08:08 +0000
committerkosako <kosako@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-03-23 12:08:08 +0000
commitf69c1f18ee4d5ddd0aa5e865360f8b14c34e37de (patch)
treea228f2ce7132e82b99381a69afcd3f05b9737488 /regcomp.c
parent0fa1086760eb0a5964789eb619769764107458ca (diff)
merge Oniguruma 4.0.2
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/regcomp.c b/regcomp.c
index f60438370d..922e65b086 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -4875,6 +4875,11 @@ onig_alloc_init(regex_t** reg, OnigOptionType option, OnigAmbigType ambig_flag,
if (ONIGENC_IS_UNDEF(enc))
return ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED;
+ if ((option & (ONIG_OPTION_DONT_CAPTURE_GROUP|ONIG_OPTION_CAPTURE_GROUP))
+ == (ONIG_OPTION_DONT_CAPTURE_GROUP|ONIG_OPTION_CAPTURE_GROUP)) {
+ return ONIGERR_INVALID_COMBINATION_OF_OPTIONS;
+ }
+
*reg = (regex_t* )xmalloc(sizeof(regex_t));
if (IS_NULL(*reg)) return ONIGERR_MEMORY;
(*reg)->state = ONIG_STATE_MODIFY;