diff options
Diffstat (limited to 'lib/skin_parser/skin_parser.c')
-rw-r--r-- | lib/skin_parser/skin_parser.c | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/lib/skin_parser/skin_parser.c b/lib/skin_parser/skin_parser.c index 2ce41c6d9a..5bc5984fb7 100644 --- a/lib/skin_parser/skin_parser.c +++ b/lib/skin_parser/skin_parser.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <stdio.h> | 23 | #include <stdio.h> |
24 | #include <string.h> | 24 | #include <string.h> |
25 | #include <ctype.h> | 25 | #include <ctype.h> |
26 | #include <stdbool.h> | ||
26 | 27 | ||
27 | #include "skin_buffer.h" | 28 | #include "skin_buffer.h" |
28 | #include "skin_parser.h" | 29 | #include "skin_parser.h" |
@@ -534,7 +535,7 @@ static int skin_parse_tag(struct skin_element* element, char** document) | |||
534 | /* Storing the type code */ | 535 | /* Storing the type code */ |
535 | element->params[i].type_code = *tag_args; | 536 | element->params[i].type_code = *tag_args; |
536 | 537 | ||
537 | /* Checking a nullable argument for null */ | 538 | /* Checking a nullable argument for null. */ |
538 | if(*cursor == DEFAULTSYM && !isdigit(cursor[1])) | 539 | if(*cursor == DEFAULTSYM && !isdigit(cursor[1])) |
539 | { | 540 | { |
540 | if(islower(*tag_args)) | 541 | if(islower(*tag_args)) |
@@ -557,8 +558,36 @@ static int skin_parse_tag(struct skin_element* element, char** document) | |||
557 | return 0; | 558 | return 0; |
558 | } | 559 | } |
559 | 560 | ||
560 | element->params[i].type = NUMERIC; | 561 | element->params[i].type = INTEGER; |
561 | element->params[i].data.numeric = scan_int(&cursor); | 562 | element->params[i].data.number = scan_int(&cursor); |
563 | } | ||
564 | else if(tolower(*tag_args) == 'd') | ||
565 | { | ||
566 | int val = 0; | ||
567 | bool have_point = false; | ||
568 | bool have_tenth = false; | ||
569 | while ( isdigit(*cursor) || *cursor == '.' ) | ||
570 | { | ||
571 | if (*cursor != '.') | ||
572 | { | ||
573 | val *= 10; | ||
574 | val += *cursor - '0'; | ||
575 | if (have_point) | ||
576 | { | ||
577 | have_tenth = true; | ||
578 | cursor++; | ||
579 | break; | ||
580 | } | ||
581 | } | ||
582 | else | ||
583 | have_point = true; | ||
584 | cursor++; | ||
585 | } | ||
586 | if (have_tenth == false) | ||
587 | val *= 10; | ||
588 | |||
589 | element->params[i].type = DECIMAL; | ||
590 | element->params[i].data.number = val; | ||
562 | } | 591 | } |
563 | else if(tolower(*tag_args) == 'n' || | 592 | else if(tolower(*tag_args) == 'n' || |
564 | tolower(*tag_args) == 's' || tolower(*tag_args) == 'f') | 593 | tolower(*tag_args) == 's' || tolower(*tag_args) == 'f') |