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 b9485208ab..dbb5cbe93e 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) | |||
456 | return 1; | 456 | return 1; |
457 | } | 457 | } |
458 | 458 | ||
459 | /* Eating a newline if necessary */ | ||
460 | if(tag_args[0] == '\n') | ||
461 | { | ||
462 | if(*cursor == '\n') | ||
463 | cursor++; | ||
464 | *document = cursor; | ||
465 | return 1; | ||
466 | } | ||
467 | |||
459 | /* Checking the number of arguments and allocating args */ | 468 | /* Checking the number of arguments and allocating args */ |
460 | if(*cursor != ARGLISTOPENSYM && tag_args[0] != '|') | 469 | if(*cursor != ARGLISTOPENSYM && tag_args[0] != '|' |
470 | && tag_args[0] != '\n') | ||
461 | { | 471 | { |
462 | skin_error(ARGLIST_EXPECTED); | 472 | skin_error(ARGLIST_EXPECTED); |
463 | return 0; | 473 | return 0; |
@@ -505,7 +515,7 @@ static int skin_parse_tag(struct skin_element* element, char** document) | |||
505 | for(i = 0; i < num_args; i++) | 515 | for(i = 0; i < num_args; i++) |
506 | { | 516 | { |
507 | /* Making sure we haven't run out of arguments */ | 517 | /* Making sure we haven't run out of arguments */ |
508 | if(*tag_args == '\0') | 518 | if(*tag_args == '\0' || *tag_args == '\n') |
509 | { | 519 | { |
510 | skin_error(TOO_MANY_ARGS); | 520 | skin_error(TOO_MANY_ARGS); |
511 | return 0; | 521 | return 0; |
@@ -604,12 +614,16 @@ static int skin_parse_tag(struct skin_element* element, char** document) | |||
604 | } | 614 | } |
605 | 615 | ||
606 | /* Checking for a premature end */ | 616 | /* Checking for a premature end */ |
607 | if(*tag_args != '\0' && !optional) | 617 | if(*tag_args != '\0' && *tag_args != '\n' && !optional) |
608 | { | 618 | { |
609 | skin_error(INSUFFICIENT_ARGS); | 619 | skin_error(INSUFFICIENT_ARGS); |
610 | return 0; | 620 | return 0; |
611 | } | 621 | } |
612 | 622 | ||
623 | if(*tag_args == '\n') | ||
624 | if(*cursor == '\n') | ||
625 | cursor++; | ||
626 | |||
613 | *document = cursor; | 627 | *document = cursor; |
614 | 628 | ||
615 | return 1; | 629 | return 1; |