diff options
| author | ruki <[email protected]> | 2019-07-10 22:41:05 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-07-10 10:06:31 +0800 |
| commit | 306462119f4eac0d30befc50fe0aa5a49e7fd400 (patch) | |
| tree | 91eafd9b913bfd456e9bb186359152fb04226c31 /core/src/xmake/io/file_write.c | |
| parent | b4489894d1bd688c81e1a5d8509fb7d09e987430 (diff) | |
fix io.write cache
Diffstat (limited to 'core/src/xmake/io/file_write.c')
| -rw-r--r-- | core/src/xmake/io/file_write.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/src/xmake/io/file_write.c b/core/src/xmake/io/file_write.c index cf3ccca59..57c2043ea 100644 --- a/core/src/xmake/io/file_write.c +++ b/core/src/xmake/io/file_write.c @@ -48,12 +48,12 @@ static tb_void_t xm_io_file_write_file_transcrlf(xm_io_file* file, tb_char_t con tb_assert(file && data && xm_io_file_is_file(file) && !xm_io_file_is_closed(file)); // write cached data first - tb_byte_t const* odata = tb_buffer_data(&file->line); - tb_size_t osize = tb_buffer_size(&file->line); + tb_byte_t const* odata = tb_buffer_data(&file->wcache); + tb_size_t osize = tb_buffer_size(&file->wcache); if (odata && osize) { if (!tb_stream_bwrit(file->file_ref, odata, osize)) return ; - tb_buffer_clear(&file->line); + tb_buffer_clear(&file->wcache); } // write data by lines @@ -81,7 +81,7 @@ static tb_void_t xm_io_file_write_file_transcrlf(xm_io_file* file, tb_char_t con else { // cache the left data - tb_buffer_memncat(&file->line, (tb_byte_t const*)p, e - p); + tb_buffer_memncat(&file->wcache, (tb_byte_t const*)p, e - p); p = e; break; } |
