e6dfe8
From d31ebaf3eb3c4ead397c054cbe1a7dbfe331aad5 Mon Sep 17 00:00:00 2001
e6dfe8
Message-Id: <d31ebaf3eb3c4ead397c054cbe1a7dbfe331aad5@dist-git>
e6dfe8
From: Pino Toscano <ptoscano@redhat.com>
e6dfe8
Date: Thu, 12 Apr 2018 17:26:20 +0200
e6dfe8
Subject: [PATCH] internal: add STRCASEPREFIX
e6dfe8
MIME-Version: 1.0
e6dfe8
Content-Type: text/plain; charset=UTF-8
e6dfe8
Content-Transfer-Encoding: 8bit
e6dfe8
e6dfe8
Simple macro to check the prefix of a string in a case-insensitive way.
e6dfe8
e6dfe8
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
e6dfe8
(cherry picked from commit e508e04b108709af0ca2c4d6728440b0edc3cc4b)
e6dfe8
e6dfe8
https: //bugzilla.redhat.com/show_bug.cgi?id=1566524
e6dfe8
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
e6dfe8
Reviewed-by: Ján Tomko <jtomko@redhat.com>
e6dfe8
---
e6dfe8
 src/internal.h | 1 +
e6dfe8
 1 file changed, 1 insertion(+)
e6dfe8
e6dfe8
diff --git a/src/internal.h b/src/internal.h
e6dfe8
index c29f20f022..f5e7a1886c 100644
e6dfe8
--- a/src/internal.h
e6dfe8
+++ b/src/internal.h
e6dfe8
@@ -75,6 +75,7 @@
e6dfe8
 # define STRNEQLEN(a, b, n) (strncmp(a, b, n) != 0)
e6dfe8
 # define STRCASENEQLEN(a, b, n) (c_strncasecmp(a, b, n) != 0)
e6dfe8
 # define STRPREFIX(a, b) (strncmp(a, b, strlen(b)) == 0)
e6dfe8
+# define STRCASEPREFIX(a, b) (c_strncasecmp(a, b, strlen(b)) == 0)
e6dfe8
 # define STRSKIP(a, b) (STRPREFIX(a, b) ? (a) + strlen(b) : NULL)
e6dfe8
 
e6dfe8
 # define STREQ_NULLABLE(a, b)                           \
e6dfe8
-- 
e6dfe8
2.17.0
e6dfe8