summaryrefslogtreecommitdiff
path: root/source/fitz/string.c
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2016-04-28 14:54:48 +0200
committerTor Andersson <tor.andersson@artifex.com>2016-05-13 11:42:00 +0200
commit049164b3f4f7d9ca4eaa59db41155c0a9936e0d3 (patch)
tree5d0974b53c133f699371fc795857c6c5c158be48 /source/fitz/string.c
parentc99afdde9b0032daa5b64107bd063180ffc3ad3b (diff)
downloadmupdf-049164b3f4f7d9ca4eaa59db41155c0a9936e0d3.tar.xz
Move string compare helper to other string functions.
Diffstat (limited to 'source/fitz/string.c')
-rw-r--r--source/fitz/string.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/fitz/string.c b/source/fitz/string.c
index 025b612c..95b216fe 100644
--- a/source/fitz/string.c
+++ b/source/fitz/string.c
@@ -1,5 +1,25 @@
#include "mupdf/fitz.h"
+static inline int
+fz_tolower(int c)
+{
+ if (c >= 'A' && c <= 'Z')
+ return c + 32;
+ return c;
+}
+
+int
+fz_strcasecmp(const char *a, const char *b)
+{
+ while (fz_tolower(*a) == fz_tolower(*b))
+ {
+ if (*a++ == 0)
+ return 0;
+ b++;
+ }
+ return fz_tolower(*a) - fz_tolower(*b);
+}
+
char *
fz_strsep(char **stringp, const char *delim)
{