diff options
author | nyamatongwe <devnull@localhost> | 2001-02-07 10:44:39 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2001-02-07 10:44:39 +0000 |
commit | 98d7f31f8ebb9d8cbe94cacb884dfecb791eb296 (patch) | |
tree | 889d07410c53983ffd633f39ddb4fcde98f2b0ba /src | |
parent | 71e8a6cbf3277010d8dbde0c2429e985c43933c2 (diff) | |
download | scintilla-mirror-98d7f31f8ebb9d8cbe94cacb884dfecb791eb296.tar.gz |
GetWild does file extension comparison case insensitively.
Diffstat (limited to 'src')
-rw-r--r-- | src/PropSet.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/PropSet.cxx b/src/PropSet.cxx index a29a4f6bb..45419bcd1 100644 --- a/src/PropSet.cxx +++ b/src/PropSet.cxx @@ -200,13 +200,14 @@ bool isprefix(const char *target, const char *prefix) { return true; } -bool issuffix(const char *target, const char *suffix) { +static bool IsSuffixCaseInsensitive(const char *target, const char *suffix) { int lentarget = strlen(target); int lensuffix = strlen(suffix); if (lensuffix > lentarget) return false; for (int i = lensuffix - 1; i >= 0; i--) { - if (target[i + lentarget - lensuffix] != suffix[i]) + if (MakeUpperCase(target[i + lentarget - lensuffix]) != + MakeUpperCase(suffix[i])) return false; } return true; @@ -240,7 +241,7 @@ SString PropSet::GetWild(const char *keybase, const char *filename) { char delchr = *del; *del = '\0'; if (*keyfile == '*') { - if (issuffix(filename, keyfile + 1)) { + if (IsSuffixCaseInsensitive(filename, keyfile + 1)) { *del = delchr; free(keyptr); return p->val; |