From 3ce77a30236441af7fd47413da8d2e67f10ae950 Mon Sep 17 00:00:00 2001 From: "K.Kosako" Date: Tue, 2 Apr 2024 23:02:00 +0900 Subject: fix total call with whole options --- src/regcomp.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/regcomp.c b/src/regcomp.c index 10da9c4..9f2d5aa 100644 --- a/src/regcomp.c +++ b/src/regcomp.c @@ -2,7 +2,7 @@ regcomp.c - Oniguruma (regular expression library) **********************************************************************/ /*- - * Copyright (c) 2002-2023 K.Kosako + * Copyright (c) 2002-2024 K.Kosako * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -5197,12 +5197,18 @@ check_call_reference(CallNode* cn, ParseEnv* env, int state) #ifdef USE_WHOLE_OPTIONS static int -check_whole_options_position(Node* node /* root */) +check_whole_options_position(Node* node /* root */, ParseEnv* env) { int is_list; is_list = FALSE; +#ifdef USE_CALL + if ((env->flags & PE_FLAG_HAS_CALL_ZERO) != 0) { + node = ND_BODY(node); + } +#endif + start: switch (ND_TYPE(node)) { case ND_LIST: @@ -7394,7 +7400,7 @@ static int parse_and_tune(regex_t* reg, const UChar* pattern, #ifdef USE_WHOLE_OPTIONS if ((scan_env->flags & PE_FLAG_HAS_WHOLE_OPTIONS) != 0) { - r = check_whole_options_position(root); + r = check_whole_options_position(root, scan_env); if (r != 0) goto err; } #endif -- cgit v1.1