aboutsummaryrefslogtreecommitdiffhomepage
path: root/common.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-03-01 17:31:45 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-03-01 17:31:45 -0800
commit36622c35781c3212c2102c45781a496f3e1b3659 (patch)
tree532707edfd80cd1a903489d3e9feef112a550ce2 /common.cpp
parentfd4df6f9bb918d62ae31881230f2d5f8b09e129e (diff)
Fix to properly handle case insensitive autosuggestions
Diffstat (limited to 'common.cpp')
-rw-r--r--common.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/common.cpp b/common.cpp
index f2fcc8cf..a0c3fe79 100644
--- a/common.cpp
+++ b/common.cpp
@@ -1961,6 +1961,11 @@ bool string_prefixes_string(const wcstring &proposed_prefix, const wcstring &val
return prefix_size <= value.size() && value.compare(0, prefix_size, proposed_prefix) == 0;
}
+bool string_prefixes_string_case_insensitive(const wcstring &proposed_prefix, const wcstring &value) {
+ size_t prefix_size = proposed_prefix.size();
+ return prefix_size <= value.size() && wcsncasecmp(proposed_prefix.c_str(), value.c_str(), prefix_size) == 0;
+}
+
bool list_contains_string(const wcstring_list_t &list, const wcstring &str)
{
return std::find(list.begin(), list.end(), str) != list.end();