From a191d664e9ef78d0b413c349c8608148cc2e455d Mon Sep 17 00:00:00 2001 From: xzyfer Date: Wed, 7 Jan 2015 16:57:43 +1100 Subject: [PATCH] str-slice() $end-at should default to -1 if omitted --- functions.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/functions.cpp b/functions.cpp index 737b3b885b..c824f94070 100644 --- a/functions.cpp +++ b/functions.cpp @@ -904,7 +904,10 @@ namespace Sass { // `str-slice` should always return an empty string when $end-at == 0 // `normalize_index` normalizes 1 -> 0 so we need to check the original value - if(start == end && m->value() > 0) { + if(m->value() == 0) { + if(!quotemark) return new (ctx.mem) Null(pstate); + newstr = ""; + } else if(start == end && m->value() > 0) { newstr = str.substr(start, 1); } else if(end > start) { newstr = str.substr(start, end - start + UTF_8::code_point_size_at_offset(str, end));