From: Jakub Pawlowicz Date: Fri, 18 Sep 2015 06:37:06 +0000 (+0100) Subject: Fixes comment restoring on Windows. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=8e9474c6e75dd91cf7391c96a06980d8ca816d49;p=clean-css.git Fixes comment restoring on Windows. Windows line break is two characters long, so we need to take that into account. --- diff --git a/lib/text/comments-processor.js b/lib/text/comments-processor.js index 941fc670..2063b53a 100644 --- a/lib/text/comments-processor.js +++ b/lib/text/comments-processor.js @@ -113,7 +113,7 @@ function restore(context, data, from, isSpecial) { cursor = nextMatch.end; } else { - cursor = nextMatch.end + (context.keepBreaks && data[nextMatch.end] == lineBreak ? 1 : 0); + cursor = nextMatch.end + (context.keepBreaks && data.substring(nextMatch.end, nextMatch.end + lineBreak.length) == lineBreak ? lineBreak.length : 0); } }