From 93f2e2ea5b5e9fa52f898a4a2391413e74c2813b Mon Sep 17 00:00:00 2001 From: Nathan McRae Date: Thu, 15 Feb 2024 20:24:44 -0800 Subject: [PATCH] Make comments not end with \n --- SaneTsv/SaneTsv.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SaneTsv/SaneTsv.cs b/SaneTsv/SaneTsv.cs index e828d9b..1ff839c 100644 --- a/SaneTsv/SaneTsv.cs +++ b/SaneTsv/SaneTsv.cs @@ -231,8 +231,11 @@ public class SaneTsv { var commentBytes = new byte[j - i - 1]; Array.Copy(inputBuffer, i + 1, commentBytes, 0, j - i - 1); + if (currentComment.Length > 0) + { + currentComment.Append('\n'); + } currentComment.Append(Encoding.UTF8.GetString(commentBytes)); - currentComment.Append("\n"); i = j; currentLineStart = i + 1; line++;