mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-03 00:55:11 -07:00
Use isspace\n\n\nThx Dylan
This commit is contained in:
@@ -90,7 +90,7 @@ static VALUE rb_variable_allocate(VALUE klass)
|
|||||||
static int skip_whitespace(char * str, int len)
|
static int skip_whitespace(char * str, int len)
|
||||||
{
|
{
|
||||||
int i = 0; char * ptr = str;
|
int i = 0; char * ptr = str;
|
||||||
while (i < len && (*ptr == " " || *ptr == "\t" || *ptr == "\n" || *ptr == "\v" || *ptr == "\f" || *ptr == "\r"))
|
while (i < len && !isspace(*ptr))
|
||||||
i++;
|
i++;
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
@@ -119,8 +119,7 @@ static char * get_quoted_fragment(char * cursor, int len, char * name)
|
|||||||
else {end = count+1; goto form_name;}
|
else {end = count+1; goto form_name;}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (cursor[count] != '|' && cursor[count] != ':' && cursor[count] != ',' && cursor[count] != ' ' &&
|
if (cursor[count] != '|' && cursor[count] != ':' && cursor[count] != ',' && cursor[count] != ' ' && !isspace(cursor[count]))
|
||||||
cursor[count] != '\n' && cursor[count] != '\v' && cursor[count] != '\t' && cursor[count] != '\f' && cursor[count] != '\r')
|
|
||||||
{ if (start == -1) start = count; }
|
{ if (start == -1) start = count; }
|
||||||
else
|
else
|
||||||
{ end = count+1; goto form_name;}
|
{ end = count+1; goto form_name;}
|
||||||
|
|||||||
Reference in New Issue
Block a user