aboutsummaryrefslogtreecommitdiffstats
path: root/indep.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2013-04-08 12:56:59 +0000
committerTatsuya Kinoshita <tats@debian.org>2013-04-08 12:56:59 +0000
commitfa5bc4b95d1ea172e465ee4186724130cbe16414 (patch)
tree65d67bec6c1b212301c4745e4c99e18bd1109931 /indep.c
parentMerge branch 'feature/sgrmouse' (diff)
parentOne more patch for siteconf from [w3m-dev 04464] (diff)
downloadw3m-fa5bc4b95d1ea172e465ee4186724130cbe16414.tar.gz
w3m-fa5bc4b95d1ea172e465ee4186724130cbe16414.zip
Merge branch 'feature/siteconf'
Diffstat (limited to 'indep.c')
-rw-r--r--indep.c14
1 files changed, 14 insertions, 0 deletions
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)
{