1
0
Fork 0
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:
Magnus Holmgren 2007-05-02 16:28:24 +00:00
parent 378a140ae2
commit 05a158ecf3

View file

@ -1311,9 +1311,9 @@ static int evaluate_conditional(struct gui_wps *gwps, int cond_index)
result, sizeof(result), &intval);
/* 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)
intval = value ? 1 : num_options;
intval = value && strlen(value) ? 1 : num_options;
else if (intval > num_options || intval < 1)
intval = num_options;