Skip to content

Commit

Permalink
Merge pull request sass#567 from am11/master
Browse files Browse the repository at this point in the history
Function: Fixes str-slice behavior (sass#565)
  • Loading branch information
HamptonMakes committed Oct 27, 2014
2 parents 8fd3adb + 9b9b833 commit 28b0496
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -876,9 +876,9 @@ namespace Sass {
size_t start = UTF_8::offset_at_position(str, UTF_8::normalize_index(n->value(), UTF_8::code_point_count(str)));
size_t end = UTF_8::offset_at_position(str, UTF_8::normalize_index(m->value(), UTF_8::code_point_count(str)));

if(start - end == 0) {
newstr = str.substr(start, end - start);
} else {
if(start == end) {
newstr = str.substr(start, 1);
} else if(end > start) {
newstr = str.substr(start, end - start + UTF_8::code_point_size_at_offset(str, end));
}
if(quotemark) {
Expand Down

0 comments on commit 28b0496

Please sign in to comment.