summaryrefslogtreecommitdiffstats
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
commit3ec3fcb621fef1784b75c07ea05072b95aad7efb (patch)
treea228f2ce7132e82b99381a69afcd3f05b9737488 /regcomp.c
parent7f717c8dfc8c1d5595764ba14e527f21c60ec9d2 (diff)
downloadruby-3ec3fcb621fef1784b75c07ea05072b95aad7efb.tar.gz
ruby-3ec3fcb621fef1784b75c07ea05072b95aad7efb.tar.xz
ruby-3ec3fcb621fef1784b75c07ea05072b95aad7efb.zip
merge Oniguruma 4.0.2
git-svn-id: http://svn.ruby-lang.org/repos/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 f60438370..922e65b08 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;