Only override the comma value on *_init if it is "invalid"
This commit is contained in:
1 parent
2416380f34
commit
3812d5e002
2 files changed
+8
-2
No files matched your search
@@ -17,7 +17,10 @@ Writer :: struct {
|
||||
|
||||
// writer_init initializes a Writer that writes to w
|
||||
writer_init :: proc(writer: ^Writer, w: io.Writer) {
|
||||
writer.comma = ','
|
||||
switch writer.comma {
|
||||
case '\x00', '\n', '\r', 0xfffd:
|
||||
writer.comma = ','
|
||||
}
|
||||
writer.w = w
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user