diff options
| author | 2009-03-28 13:55:58 +0000 | |
|---|---|---|
| committer | 2009-03-28 13:55:58 +0000 | |
| commit | 188c064713edc5d619919f63a5dd534ff45c4d72 (patch) | |
| tree | 06a4b6fc6c73283a5ca7ecd08dd1c37dabaf61e7 /src/lib | |
| parent | bf6e4ba77e47458aafeebe1d0d62848a92e9e23f (diff) | |
'fixed' core_strwildcmp by increasing the limit from 8 to 16 characters
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/util/corestr.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/lib/util/corestr.c b/src/lib/util/corestr.c index c3780c9632b..c30c7b453ce 100644 --- a/src/lib/util/corestr.c +++ b/src/lib/util/corestr.c @@ -51,49 +51,49 @@ int core_strnicmp(const char *s1, const char *s2, size_t n) /*------------------------------------------------- core_strwildcmp - case-insensitive wildcard - string compare (up to 8 characters at the + string compare (up to 16 characters at the moment) -------------------------------------------------*/ int core_strwildcmp(const char *sp1, const char *sp2) { - char s1[9], s2[9]; + char s1[17], s2[17]; int i, l1, l2; char *p; - strncpy(s1, sp1, 8); s1[8] = 0; if (s1[0] == 0) strcpy(s1, "*"); + strncpy(s1, sp1, 16); s1[16] = 0; if (s1[0] == 0) strcpy(s1, "*"); - strncpy(s2, sp2, 8); s2[8] = 0; if (s2[0] == 0) strcpy(s2, "*"); + strncpy(s2, sp2, 16); s2[16] = 0; if (s2[0] == 0) strcpy(s2, "*"); p = strchr(s1, '*'); if (p) { - for (i = p - s1; i < 8; i++) s1[i] = '?'; - s1[8] = 0; + for (i = p - s1; i < 16; i++) s1[i] = '?'; + s1[16] = 0; } p = strchr(s2, '*'); if (p) { - for (i = p - s2; i < 8; i++) s2[i] = '?'; - s2[8] = 0; + for (i = p - s2; i < 16; i++) s2[i] = '?'; + s2[16] = 0; } l1 = (int)strlen(s1); - if (l1 < 8) + if (l1 < 16) { - for (i = l1 + 1; i < 8; i++) s1[i] = ' '; - s1[8] = 0; + for (i = l1 + 1; i < 16; i++) s1[i] = ' '; + s1[16] = 0; } l2 = (int)strlen(s2); - if (l2 < 8) + if (l2 < 16) { - for (i = l2 + 1; i < 8; i++) s2[i] = ' '; - s2[8] = 0; + for (i = l2 + 1; i < 16; i++) s2[i] = ' '; + s2[16] = 0; } - for (i = 0; i < 8; i++) + for (i = 0; i < 16; i++) { if (s1[i] == '?' && s2[i] != '?') s1[i] = s2[i]; if (s2[i] == '?' && s1[i] != '?') s2[i] = s1[i]; |
