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: [PATCH] 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. --- plugins/check_curl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/check_curl.c b/plugins/check_curl.c index bf46b226..38c97109 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; -- 2.11.4.GIT