Skip to content

Commit

Permalink
Update regex_mod.c
Browse files Browse the repository at this point in the history
- add mi_pcres_match_group brief comment.
- revert misleading error tabulation.
  • Loading branch information
Integration-IT committed Aug 17, 2023
1 parent b5050f1 commit ede29b2
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions modules/regex/regex_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ static int mod_init(void)

return 0;

err:
free_shared_memory();
return -1;
err:
free_shared_memory();
return -1;
}


Expand Down Expand Up @@ -719,6 +719,9 @@ mi_response_t *mi_pcres_match(const mi_params_t *params, struct mi_handler *asyn
}
}

/*! \brief It uses the groups readed from the text file to match the given string parameter against
* the compiled regular expression in group number group
*/
mi_response_t *mi_pcres_match_group(const mi_params_t *params, struct mi_handler *async_hdl)
{
str string, group;
Expand All @@ -735,9 +738,9 @@ mi_response_t *mi_pcres_match_group(const mi_params_t *params, struct mi_handler
}

/*
type casting MI Param -> int(group) function.
L.616 already test if group is an integer, if not, default 0 is set.
*/
* type casting MI Param -> int(group) function.
* L.616 already test if group is an integer, if not, default 0 is set.
*/
_group = atoi(group.s);

/* No possible negative index */
Expand All @@ -755,7 +758,7 @@ mi_response_t *mi_pcres_match_group(const mi_params_t *params, struct mi_handler
return init_mi_error(500, MI_SSTR("Error invalid pcre index"));
break;
case -2:
/* group is disabled*/
/* group is disabled */
return init_mi_error(500, MI_SSTR("Error group matching is disabled"));
break;
case -1:
Expand Down

0 comments on commit ede29b2

Please sign in to comment.