| ... | ... | @@ -163,12 +163,8 @@ fn ensureAllValuesUsed( |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | fn detectNewline(contents: []const u8) []const u8 { |
| 166 | | return if (std.mem.endsWith(u8, contents, "\r\n")) |
| 167 | | "\r\n" |
| 168 | | else if (std.mem.endsWith(u8, contents, "\n")) |
| 169 | | "\n" |
| 170 | | else |
| 171 | | os_newline; |
| 166 | const lf_index = std.mem.findScalar(u8, contents, '\n') orelse return os_newline; |
| 167 | return if (lf_index > 0 and contents[lf_index - 1] == '\r') "\r\n" else "\n"; |
| 172 | 168 | } |
| 173 | 169 | |
| 174 | 170 | fn renderAutoConfUndef( |