check_curl: Parse state-regex option ignoring case

Previously the --state-regex option accepted only "critical" and
"warning" as values.
This commit changes the strcmp there to strcasecmp to be more tolerant
regarding the input.
This commit is contained in:
RincewindsHat 2024-08-19 15:26:52 +02:00
parent 46efe803cf
commit b6c72064a5

View file

@ -1775,9 +1775,9 @@ process_arguments (int argc, char **argv)
invert_regex = true;
break;
case STATE_REGEX:
if (!strcmp (optarg, "critical"))
if (!strcasecmp (optarg, "critical"))
state_regex = STATE_CRITICAL;
else if (!strcmp (optarg, "warning"))
else if (!strcasecmp (optarg, "warning"))
state_regex = STATE_WARNING;
else usage2 (_("Invalid state-regex option"), optarg);
break;