mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-23 21:31:14 -03:00
Clean up how argv is stored in process_t
This commit is contained in:
20
common.cpp
20
common.cpp
@@ -156,20 +156,14 @@ wchar_t **list_to_char_arr( array_list_t *l )
|
||||
return res;
|
||||
}
|
||||
|
||||
wchar_t **completions_to_char_arr( std::vector<completion_t> &l )
|
||||
wcstring_list_t completions_to_wcstring_list( const std::vector<completion_t> &list )
|
||||
{
|
||||
wchar_t ** res = (wchar_t **)malloc( sizeof(wchar_t *)*( l.size() + 1) );
|
||||
size_t i;
|
||||
if( res == 0 )
|
||||
{
|
||||
DIE_MEM();
|
||||
}
|
||||
for( i=0; i< l.size(); i++ )
|
||||
{
|
||||
res[i] = wcsdup(l.at(i).completion.c_str());
|
||||
}
|
||||
res[i]='\0';
|
||||
return res;
|
||||
wcstring_list_t strings;
|
||||
strings.reserve(list.size());
|
||||
for (std::vector<completion_t>::const_iterator iter = list.begin(); iter != list.end(); iter++) {
|
||||
strings.push_back(iter->completion);
|
||||
}
|
||||
return strings;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user