Skip to content

Commit

Permalink
Merge pull request #2357 from mgreter/netbsd-2120
Browse files Browse the repository at this point in the history
Fix compiler issue with spec regression on NetBSD 6.1
  • Loading branch information
mgreter authored and xzyfer committed May 2, 2017
1 parent 0d7c6b0 commit c879b41
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions src/lexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,26 +79,29 @@ namespace Sass {
// but with specific ranges (copied from Ruby Sass)
bool is_nonascii(const char& chr)
{
unsigned int cmp = unsigned(chr);
return (
(unsigned(chr) >= 128 && unsigned(chr) <= 15572911) ||
(unsigned(chr) >= 15630464 && unsigned(chr) <= 15712189) ||
(unsigned(chr) >= 4036001920)
(cmp >= 128 && cmp <= 15572911) ||
(cmp >= 15630464 && cmp <= 15712189) ||
(cmp >= 4036001920)
);
}

// check if char is within a reduced ascii range
// valid in a uri (copied from Ruby Sass)
bool is_uri_character(const char& chr)
{
return (unsigned(chr) > 41 && unsigned(chr) < 127) ||
unsigned(chr) == ':' || unsigned(chr) == '/';
unsigned int cmp = unsigned(chr);
return (cmp > 41 && cmp < 127) ||
cmp == ':' || cmp == '/';
}

// check if char is within a reduced ascii range
// valid for escaping (copied from Ruby Sass)
bool is_escapable_character(const char& chr)
{
return unsigned(chr) > 31 && unsigned(chr) < 127;
unsigned int cmp = unsigned(chr);
return cmp > 31 && cmp < 127;
}

// Match word character (look ahead)
Expand Down
2 changes: 1 addition & 1 deletion src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ namespace Sass {
// convert the whole output from string to a stream!?
// allocate memory for utf8 char and convert to utf8
unsigned char u[5] = {0,0,0,0,0}; utf8::append(cp, u);
for(size_t m = 0; u[m] && m < 5; m++) unq.push_back(u[m]);
for(size_t m = 0; m < 5 && u[m]; m++) unq.push_back(u[m]);

// skip some more chars?
i += len - 1; skipped = false;
Expand Down

0 comments on commit c879b41

Please sign in to comment.