diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2013-04-08 12:48:49 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2013-04-08 12:48:49 +0000 |
commit | a32bf68c85a97b3db9fe61e79c1120e21c5d5899 (patch) | |
tree | 3afa477065483bccae8fd7f333f9b2d565b64696 /indep.c | |
parent | Merge from upstream on 2012-05-22 (diff) | |
download | w3m-a32bf68c85a97b3db9fe61e79c1120e21c5d5899.tar.gz w3m-a32bf68c85a97b3db9fe61e79c1120e21c5d5899.zip |
Support the siteconf feature
Patch to support the siteconf feature, from [w3m-dev 04463]
on 2012-06-27, provided by AIDA Shinra.
Diffstat (limited to 'indep.c')
-rw-r--r-- | indep.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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) { |