summaryrefslogtreecommitdiffstats
path: root/debian/patches/Add-helper-for-case-independent-string-equality-checks.patch
blob: 8e69db9bf5df9b9e7773c4fe9cd94b67bf1f6305 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
From: Matthias Klumpp <matthias@tenstral.net>
Date: Sat, 10 Oct 2020 04:40:23 +0200
Subject: Add helper for case-independent string equality checks

(cherry picked from commit bd47b0dac4a1ff6e686c99b9958693e86d44007b)
---
 src/basic/string-util.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/basic/string-util.h b/src/basic/string-util.h
index fdd3ce7..6c99335 100644
--- a/src/basic/string-util.h
+++ b/src/basic/string-util.h
@@ -33,6 +33,10 @@ static inline bool streq_ptr(const char *a, const char *b) {
         return strcmp_ptr(a, b) == 0;
 }
 
+static inline bool strcaseeq_ptr(const char *a, const char *b) {
+        return strcasecmp_ptr(a, b) == 0;
+}
+
 static inline char* strstr_ptr(const char *haystack, const char *needle) {
         if (!haystack || !needle)
                 return NULL;