diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2013-07-30 11:13:51 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2013-07-30 11:13:51 +0000 |
commit | 18b0cc756bc5d5145fc1abcd0ef46ff2455c79ab (patch) | |
tree | 88966004acc26ea238b5414bd569b86aac1b569d /indep.c | |
parent | Sort anchors by sequence number in -dump (diff) | |
parent | Merge branch 'feature/debian-version' (diff) | |
download | w3m-18b0cc756bc5d5145fc1abcd0ef46ff2455c79ab.tar.gz w3m-18b0cc756bc5d5145fc1abcd0ef46ff2455c79ab.zip |
Merge branch 'master' into bug/sort-dump-links
Conflicts:
main.c
Diffstat (limited to '')
-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) { |