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