From 1c2ae95a59c1a5a612234d10742267c88200e1d4 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Thu, 18 Jul 2019 01:37:34 -0400 Subject: [PATCH] fix: str-slice can't start at 0 See https://github.com/sass/sass-spec/pull/1441 Closes #2920 --- src/fn_strings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fn_strings.cpp b/src/fn_strings.cpp index b09fce9a6c..b30e7bf275 100644 --- a/src/fn_strings.cpp +++ b/src/fn_strings.cpp @@ -185,7 +185,7 @@ namespace Sass { if (end_at > size) { end_at = (double)size; } if (start_at < 0) { start_at += size + 1; - if (start_at < 0) start_at = 0; + if (start_at <= 0) start_at = 1; } else if (start_at == 0) { ++ start_at; }