fix: add workaround for Buffer.store_to_file_const bug on non-linux platforms
This commit is contained in:
		
							parent
							
								
									d201a84ec8
								
							
						
					
					
						commit
						b556c1da61
					
				
					 1 changed files with 11 additions and 1 deletions
				
			
		|  | @ -1374,7 +1374,17 @@ pub fn store_to_string(self: *const Self, allocator: Allocator, eol_mode: EolMod | |||
| } | ||||
| 
 | ||||
| fn store_to_file_const(self: *const Self, writer: *std.Io.Writer) StoreToFileError!void { | ||||
|     try self.root.store(writer, self.file_eol_mode); | ||||
|     switch (builtin.os.tag) { | ||||
|         .linux => { | ||||
|             try self.root.store(writer, self.file_eol_mode); | ||||
|         }, | ||||
|         else => { | ||||
|             var content: std.Io.Writer.Allocating = .init(self.external_allocator); | ||||
|             defer content.deinit(); | ||||
|             try self.root.store(&content.writer, self.file_eol_mode); | ||||
|             try writer.writeAll(content.written()); | ||||
|         }, | ||||
|     } | ||||
|     try writer.flush(); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue