diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-02-26 20:11:34 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-02-26 20:11:34 -0800 |
commit | f74a82776f9a20f09149712d50cee557d8302ec0 (patch) | |
tree | c24d45936ba2d272035709f8dd7f8943cd24f5c8 /common.cpp | |
parent | 3553e650891db84b3feffaef872d378c750f807b (diff) |
Some more changes in preparation for turning on complete-based autosuggestions
Diffstat (limited to 'common.cpp')
-rw-r--r-- | common.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1870,11 +1870,17 @@ void tokenize_variable_array( const wcstring &val, std::vector<wcstring> &out) out.push_back(val.substr(pos, end - pos)); } -bool string_prefixes_string(const wcstring &proposed_prefix, const wcstring &value) { +bool string_prefixes_string(const wcstring &proposed_prefix, const wcstring &value) +{ size_t prefix_size = proposed_prefix.size(); return prefix_size <= value.size() && value.compare(0, prefix_size, proposed_prefix) == 0; } +bool list_contains_string(const wcstring_list_t &list, const wcstring &str) +{ + return std::find(list.begin(), list.end(), str) != list.end(); +} + int create_directory( const wcstring &d ) { int ok = 0; |