From 9c3229717f0cff0e0fcc329c625a0e1735243c3d Mon Sep 17 00:00:00 2001 From: tophf Date: Fri, 1 Dec 2017 00:23:06 +0300 Subject: [PATCH] fixup d660e6bd: off-by-1 in parseStringUnquoted --- js/usercss.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/usercss.js b/js/usercss.js index c98cc064..3bcf0c1a 100644 --- a/js/usercss.js +++ b/js/usercss.js @@ -252,7 +252,7 @@ var usercss = (() => { function parseStringUnquoted(state) { const pos = state.re.lastIndex; const nextQuoteOrEOL = posOrEnd(state.text, '"', pos); - state.re.lastIndex = Math.max(0, nextQuoteOrEOL - 1); + state.re.lastIndex = nextQuoteOrEOL; state.value = state.text.slice(pos, nextQuoteOrEOL).trim().replace(/\s+/g, '-'); }