summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
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 */