diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2010-09-02 11:43:33 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2010-09-02 11:43:33 +0000 |
commit | 216ed29e4dc709ac696f256e851accb8f093d1ea (patch) | |
tree | aa640f6e493d21e70d1ede51e01e3e971445aa88 /apps/gui/skin_engine/skin_display.c | |
parent | 5cc11a1914fec6d41517ab182bfe7541559e797b (diff) | |
download | rockbox-216ed29e4dc709ac696f256e851accb8f093d1ea.tar.gz rockbox-216ed29e4dc709ac696f256e851accb8f093d1ea.zip |
fix FS#11588 - %t(0) inside conditionals wasnt making that subline skip
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27983 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/skin_engine/skin_display.c')
-rw-r--r-- | apps/gui/skin_engine/skin_display.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c index 8e08343d82..d76b57976d 100644 --- a/apps/gui/skin_engine/skin_display.c +++ b/apps/gui/skin_engine/skin_display.c | |||
@@ -503,12 +503,7 @@ int evaluate_conditional(struct gui_wps *gwps, int offset, | |||
503 | char result[128]; | 503 | char result[128]; |
504 | const char *value; | 504 | const char *value; |
505 | 505 | ||
506 | /* treat ?xx<true> constructs as if they had 2 options. | 506 | int intval = num_options < 2 ? 2 : num_options; |
507 | * (i.e ?xx<true|false>) */ | ||
508 | if (num_options < 2) | ||
509 | num_options = 2; | ||
510 | |||
511 | int intval = num_options; | ||
512 | /* get_token_value needs to know the number of options in the enum */ | 507 | /* get_token_value needs to know the number of options in the enum */ |
513 | value = get_token_value(gwps, conditional->token, offset, | 508 | value = get_token_value(gwps, conditional->token, offset, |
514 | result, sizeof(result), &intval); | 509 | result, sizeof(result), &intval); |
@@ -516,11 +511,15 @@ int evaluate_conditional(struct gui_wps *gwps, int offset, | |||
516 | /* intval is now the number of the enum option we want to read, | 511 | /* intval is now the number of the enum option we want to read, |
517 | starting from 1. If intval is -1, we check if value is empty. */ | 512 | starting from 1. If intval is -1, we check if value is empty. */ |
518 | if (intval == -1) | 513 | if (intval == -1) |
519 | intval = (value && *value) ? 1 : num_options; | 514 | { |
515 | if (num_options == 1) /* so %?AA<true> */ | ||
516 | intval = (value && *value) ? 1 : 0; /* returned as 0 for true, -1 for false */ | ||
517 | else | ||
518 | intval = (value && *value) ? 1 : num_options; | ||
519 | } | ||
520 | else if (intval > num_options || intval < 1) | 520 | else if (intval > num_options || intval < 1) |
521 | intval = num_options; | 521 | intval = num_options; |
522 | 522 | ||
523 | conditional->last_value = intval -1; | ||
524 | return intval -1; | 523 | return intval -1; |
525 | } | 524 | } |
526 | 525 | ||