File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -170,7 +170,8 @@ pub const OutStream = struct {
170170 if (self .index == 0 )
171171 return ;
172172
173- return self .unbufferedWrite (self .buffer [0.. self .index ]);
173+ % return self .unbufferedWrite (self .buffer [0.. self .index ]);
174+ self .index = 0 ;
174175 }
175176
176177 pub fn close (self : & OutStream ) {
@@ -216,12 +217,10 @@ pub const OutStream = struct {
216217
217218 fn unbufferedWrite (self : & OutStream , bytes : []const u8 ) - > % void {
218219 if (is_posix ) {
219- % return os .posixWrite (self .fd , self .buffer [0.. self .index ]);
220- self .index = 0 ;
220+ % return os .posixWrite (self .fd , bytes );
221221 } else if (is_windows ) {
222222 const handle = % return self .getHandle ();
223- % return os .windowsWrite (handle , self .buffer [0.. self .index ]);
224- self .index = 0 ;
223+ % return os .windowsWrite (handle , bytes );
225224 } else {
226225 @compileError ("Unsupported OS" );
227226 }
You can’t perform that action at this time.
0 commit comments