Skip to content

Commit

Permalink
Fix str-slice function with negative size
Browse files Browse the repository at this point in the history
Fixes #2132
  • Loading branch information
Ian Mitchell authored and mgreter committed Aug 3, 2016
1 parent 55c0858 commit f96ec46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ namespace Sass {
std::string str = unquote(s->value());

size_t size = utf8::distance(str.begin(), str.end());
if (end_at <= size * -1.0) { end_at += size; }
if (end_at <= size * -1.0 && size > 1) { end_at += size; }
if (end_at < 0) { end_at += size + 1; }
if (end_at > size) { end_at = (double)size; }
if (start_at < 0) { start_at += size + 1; }
Expand Down

0 comments on commit f96ec46

Please sign in to comment.