diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/Parameters.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/main/Parameters.c b/src/main/Parameters.c index 3130be96..48467434 100644 --- a/src/main/Parameters.c +++ b/src/main/Parameters.c @@ -203,11 +203,6 @@ static void ParameterActivate(t_param *param); ********************* Other Routine Prototypes ********************* ********************************************************************/ -int CCTK_RegexMatch (const char *string, - const char *pattern, - const int nmatch, - regmatch_t *pmatch); - extern void CCTKi_SetParameterSetMask (int mask); /******************************************************************** @@ -2107,13 +2102,20 @@ static int ParameterSetString (t_param *param, const char *value) CCTK_Equals (param->props->thorn, range->origin)) { #ifndef CCTK_PARAMUNCHECKED - if (CCTK_RegexMatch (value, range->range, 0, NULL)) + const int matched = CCTK_RegexMatch (value, range->range, 0, NULL); + if (matched > 0) { #endif retval = CCTK_SetString (param->data, value); break; #ifndef CCTK_PARAMUNCHECKED } + else if (matched < 0) + { + CCTK_VWarn(CCTK_WARN_ALERT, __LINE__, __FILE__, "Cactus", + "Invalid regular expression '%s' used as range for string %s::%s", + range->range, param->props->thorn, param->props->name); + } #endif } } @@ -2151,13 +2153,20 @@ static int ParameterSetSentence (t_param *param, const char *value) CCTK_Equals (param->props->thorn, range->origin)) { #ifndef CCTK_PARAMUNCHECKED - if (CCTK_RegexMatch (value, range->range, 0, NULL)) + const int matched = CCTK_RegexMatch (value, range->range, 0, NULL); + if (matched > 0) { #endif retval = CCTK_SetString (param->data, value); break; #ifndef CCTK_PARAMUNCHECKED } + else if (matched < 0) + { + CCTK_VWarn(CCTK_WARN_ALERT, __LINE__, __FILE__, "Cactus", + "Invalid regular expression '%s' used as range for sequence %s::%s", + range->range, param->props->thorn, param->props->name); + } #endif } } |