From 691510074d2ce40c14f9813ec916f6b5fc855d3b Mon Sep 17 00:00:00 2001 From: Matt Artist Date: Wed, 27 Nov 2024 12:52:42 -0500 Subject: [PATCH 1/2] fix: add character to escapedVal --- ini.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ini.js b/ini.js index b2200f2..6aa3833 100644 --- a/ini.js +++ b/ini.js @@ -232,6 +232,7 @@ const unsafe = (val) => { if(val.charAt(i - 1) === ' ' && val.charAt(i + 1) === ' '){ break; } + escapedVal += char; }else if(char === '\\'){ isEscaping = true; }else{ From b3efe16ede2de509868766f8c612e7ccbdd01e7c Mon Sep 17 00:00:00 2001 From: Matt Artist Date: Wed, 27 Nov 2024 12:55:31 -0500 Subject: [PATCH 2/2] fix: test --- test/foo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/foo.js b/test/foo.js index 7e562b7..1da735c 100644 --- a/test/foo.js +++ b/test/foo.js @@ -400,7 +400,7 @@ test('ignores invalid line (=)', function(t){ test("unsafe escape values", function(t){ t.equal(ini.unsafe(''), ''); - t.equal(ini.unsafe('x;y'), 'xy'); + t.equal(ini.unsafe('x;y'), 'x;y'); t.equal(ini.unsafe('x # y'), 'x'); t.equal(ini.unsafe('x "\\'), 'x "\\'); t.end();