forked from len0rd/rockbox
Treat empty strings as 'no value' in conditionals, as it used to.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13304 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
378a140ae2
commit
05a158ecf3
1 changed files with 2 additions and 2 deletions
|
|
@ -1311,9 +1311,9 @@ static int evaluate_conditional(struct gui_wps *gwps, int cond_index)
|
||||||
result, sizeof(result), &intval);
|
result, sizeof(result), &intval);
|
||||||
|
|
||||||
/* intval is now the number of the enum option we want to read,
|
/* intval is now the number of the enum option we want to read,
|
||||||
starting from 1. If intval is -1, we check on the nullity of value. */
|
starting from 1. If intval is -1, we check if value is empty. */
|
||||||
if (intval == -1)
|
if (intval == -1)
|
||||||
intval = value ? 1 : num_options;
|
intval = value && strlen(value) ? 1 : num_options;
|
||||||
else if (intval > num_options || intval < 1)
|
else if (intval > num_options || intval < 1)
|
||||||
intval = num_options;
|
intval = num_options;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue