mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-21 11:31:15 -03:00
Removed buffer_t
This commit is contained in:
@@ -1113,16 +1113,13 @@ static void destroy()
|
||||
*/
|
||||
static void read_array( FILE* file, wcstring_list_t &comp )
|
||||
{
|
||||
buffer_t buffer;
|
||||
std::vector<char> buffer;
|
||||
int c;
|
||||
char cc;
|
||||
wchar_t *wcs;
|
||||
|
||||
b_init( &buffer );
|
||||
|
||||
while( !feof( file ) )
|
||||
{
|
||||
buffer.used=0;
|
||||
buffer.clear();
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
@@ -1137,17 +1134,14 @@ static void read_array( FILE* file, wcstring_list_t &comp )
|
||||
break;
|
||||
}
|
||||
|
||||
cc=c;
|
||||
|
||||
b_append( &buffer, &cc, 1 );
|
||||
buffer.push_back(static_cast<char>(c));
|
||||
}
|
||||
|
||||
if( buffer.used )
|
||||
if( ! buffer.empty() )
|
||||
{
|
||||
cc=0;
|
||||
b_append( &buffer, &cc, 1 );
|
||||
buffer.push_back(0);
|
||||
|
||||
wcs = str2wcs( buffer.buff );
|
||||
wcs = str2wcs( &buffer.at(0) );
|
||||
if( wcs )
|
||||
{
|
||||
wcstring tmp = wcs;
|
||||
@@ -1160,8 +1154,6 @@ static void read_array( FILE* file, wcstring_list_t &comp )
|
||||
}
|
||||
}
|
||||
|
||||
b_destroy( &buffer );
|
||||
|
||||
}
|
||||
|
||||
static int get_fd( const char *str )
|
||||
|
||||
Reference in New Issue
Block a user