From a32bf68c85a97b3db9fe61e79c1120e21c5d5899 Mon Sep 17 00:00:00 2001 From: Tatsuya Kinoshita Date: Mon, 8 Apr 2013 21:48:49 +0900 Subject: Support the siteconf feature Patch to support the siteconf feature, from [w3m-dev 04463] on 2012-06-27, provided by AIDA Shinra. --- indep.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'indep.c') diff --git a/indep.c b/indep.c index 65b04aa..89e86c1 100644 --- a/indep.c +++ b/indep.c @@ -357,6 +357,20 @@ strcasemstr(char *str, char *srch[], char **ret_ptr) return -1; } +int +strmatchlen(const char *s1, const char *s2, int maxlen) +{ + int i; + + /* To allow the maxlen to be negatie (infinity), + * compare by "!=" instead of "<=". */ + for (i = 0; i != maxlen; ++i) { + if (!s1[i] || !s2[i] || s1[i] != s2[i]) + break; + } + return i; +} + char * remove_space(char *str) { -- cgit v1.2.3