mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-08 02:31:18 -03:00
More work to excise halloc
This commit is contained in:
26
expand.cpp
26
expand.cpp
@@ -2626,16 +2626,20 @@ wchar_t *expand_one( void *context, const wchar_t *string, int flags )
|
||||
return one;
|
||||
}
|
||||
|
||||
bool expand_one( wcstring &in, int flag ) {
|
||||
bool result = false;
|
||||
wchar_t *res = expand_one(NULL, in.c_str(), flag);
|
||||
if (res) {
|
||||
in = res;
|
||||
free(res);
|
||||
result = true;
|
||||
bool expand_one(wcstring &string, int flags) {
|
||||
std::vector<completion_t> completions;
|
||||
bool result = false;
|
||||
|
||||
if( (!(flags & ACCEPT_INCOMPLETE)) && expand_is_clean( string.c_str() ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (expand_string2(string, completions, flags)) {
|
||||
if (completions.size() == 1) {
|
||||
string = completions.at(0).completion;
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user