From 3ec3fcb621fef1784b75c07ea05072b95aad7efb Mon Sep 17 00:00:00 2001 From: kosako Date: Thu, 23 Mar 2006 12:08:08 +0000 Subject: merge Oniguruma 4.0.2 git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- regcomp.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'regcomp.c') 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; -- cgit