From 71b88444004018110ad208cda0ddaab2fa0917c6 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 11 Apr 2024 13:02:13 +0100 Subject: [PATCH] Fix leading newline stripping logic --- src/lib/toml_lexer.mll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/toml_lexer.mll b/src/lib/toml_lexer.mll index 416052b..666f0aa 100644 --- a/src/lib/toml_lexer.mll +++ b/src/lib/toml_lexer.mll @@ -107,7 +107,7 @@ let trim_left_newline s = (* Is it a file with Windows newlines? *) if len > 1 then begin match (String.get s 1) with - | '\n' -> String.sub s 2 (len - 1) + | '\n' -> String.sub s 2 (len - 2) | _ -> (* Better not to think why a string starts with a \r then. *) s