diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-03-01 17:31:45 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-03-01 17:31:45 -0800 |
commit | 36622c35781c3212c2102c45781a496f3e1b3659 (patch) | |
tree | 532707edfd80cd1a903489d3e9feef112a550ce2 /common.cpp | |
parent | fd4df6f9bb918d62ae31881230f2d5f8b09e129e (diff) |
Fix to properly handle case insensitive autosuggestions
Diffstat (limited to 'common.cpp')
-rw-r--r-- | common.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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(); |