diff options
author | 2012-02-22 11:07:34 -0800 | |
---|---|---|
committer | 2012-02-22 11:07:34 -0800 | |
commit | a837a27b347e5c6b1669bbf83f7f0c0ce1c523df (patch) | |
tree | 18e98008d6de2ed36c9e9f8377829ffba9ffab45 /builtin.cpp | |
parent | 62bd43f17fa279b67fbd4482580a91fc2db9c899 (diff) |
Replace some string_buffer_t with wcstring
Diffstat (limited to 'builtin.cpp')
-rw-r--r-- | builtin.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/builtin.cpp b/builtin.cpp index 4af4f208..d7ba8a11 100644 --- a/builtin.cpp +++ b/builtin.cpp @@ -2128,10 +2128,9 @@ static int builtin_read( parser_t &parser, wchar_t **argv ) } else { - string_buffer_t sb; int eof=0; - sb_init( &sb ); + wcstring sb; while( 1 ) { @@ -2178,17 +2177,16 @@ static int builtin_read( parser_t &parser, wchar_t **argv ) if( res == L'\n' ) break; - - sb_append_char( &sb, res ); + + sb.push_back(res); } - if( sb.used < 2 && eof ) + if( sb.size() < 2 && eof ) { exit_res = 1; } - buff = wcsdup( (wchar_t *)sb.buff ); - sb_destroy( &sb ); + buff = wcsdup( sb.c_str() ); } if( i != argc && !exit_res ) |