From f869348d1fa1773550ede7fa232a2360e55430ea Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sun, 7 Jun 2020 07:40:00 -0400 Subject: [PATCH] Fix string slice extraction from parser Reported internally. Regression from: - https://github.com/gorhill/uBlock/commit/01b1ed9a982965378d732ab0cb4bcd68727fe910 The regression was made apparent be the fact that AdGuard filter lists have lines ending with the CR character. --- src/js/static-filtering-parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/static-filtering-parser.js b/src/js/static-filtering-parser.js index 3b92676f5..bcf424fb4 100644 --- a/src/js/static-filtering-parser.js +++ b/src/js/static-filtering-parser.js @@ -758,7 +758,7 @@ const Parser = class { strFromSpan(span) { if ( span.l === 0 ) { return ''; } const beg = span.i; - return this.strFromSlices(beg, beg + span.l - 1); + return this.strFromSlices(beg, beg + span.l - 3); } isBlank() {