summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2026-06-15 00:52:40 +0100
committerIan C <ianc@noddybox.co.uk>2026-06-15 00:52:40 +0100
commit47e68b48a085efbc0a71b7814659dba159314475 (patch)
tree0c7ad1ee36bdf3d35ce48b959821e677f702a4c4 /src/util.c
parentf540fb7da37d6c5b5544715e4ee6b83d440ea61d (diff)
Added type lookup to file selector. Removed old CVS tags. Added SDL keysym to char lookup.
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index c16584c..b49b780 100644
--- a/src/util.c
+++ b/src/util.c
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
+#include <ctype.h>
#include <sys/param.h>
#include "util.h"
@@ -138,4 +139,19 @@ void Debug(const char *format, ...)
va_end(ap);
}
+
+int StartsWith(const char *a, const char *b, size_t len)
+{
+ while(len && *a && *b &&
+ tolower((unsigned char)*a) == tolower((unsigned char)*b))
+ {
+ len--;
+ a++;
+ b++;
+ }
+
+ return len == 0;
+}
+
+
/* END OF FILE */