From b6c72064a53da8b173b7406a0a535922dc0cc1b3 Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Mon, 19 Aug 2024 15:26:52 +0200 Subject: 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. diff --git a/plugins/check_curl.c b/plugins/check_curl.c index bf46b22..38c9710 100644 --- a/plugins/check_curl.c +++ b/plugins/check_curl.c @@ -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; -- cgit v0.10-9-g596f