diff options
Diffstat (limited to 'lib/skin_parser/skin_parser.c')
| -rw-r--r-- | lib/skin_parser/skin_parser.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/skin_parser/skin_parser.c b/lib/skin_parser/skin_parser.c index b948520..dbb5cbe 100644 --- a/lib/skin_parser/skin_parser.c +++ b/lib/skin_parser/skin_parser.c @@ -456,8 +456,18 @@ static int skin_parse_tag(struct skin_element* element, char** document) return 1; } + /* Eating a newline if necessary */ + if(tag_args[0] == '\n') + { + if(*cursor == '\n') + cursor++; + *document = cursor; + return 1; + } + /* Checking the number of arguments and allocating args */ - if(*cursor != ARGLISTOPENSYM && tag_args[0] != '|') + if(*cursor != ARGLISTOPENSYM && tag_args[0] != '|' + && tag_args[0] != '\n') { skin_error(ARGLIST_EXPECTED); return 0; @@ -505,7 +515,7 @@ static int skin_parse_tag(struct skin_element* element, char** document) for(i = 0; i < num_args; i++) { /* Making sure we haven't run out of arguments */ - if(*tag_args == '\0') + if(*tag_args == '\0' || *tag_args == '\n') { skin_error(TOO_MANY_ARGS); return 0; @@ -604,12 +614,16 @@ static int skin_parse_tag(struct skin_element* element, char** document) } /* Checking for a premature end */ - if(*tag_args != '\0' && !optional) + if(*tag_args != '\0' && *tag_args != '\n' && !optional) { skin_error(INSUFFICIENT_ARGS); return 0; } + if(*tag_args == '\n') + if(*cursor == '\n') + cursor++; + *document = cursor; return 1; |