1
0
Fork 0
forked from len0rd/rockbox

BUGFIX string_option parsers

fix bugs introduced in the switch over to using string_option
instead of if else strcmp trees,
embedded album art should work again
skin parser had an error for 'noborder' and 'nobar'

Change-Id: I957d81e5fa8467b33bbd93d63c4428c36100acca
This commit is contained in:
William Wilgus 2022-03-14 17:16:48 -04:00
parent 6dcbf7ff77
commit 9b4e784560
4 changed files with 38 additions and 25 deletions

View file

@ -1051,12 +1051,15 @@ static int parse_progressbar_tag(struct skin_element* element,
enum
{
eINVERT = 0, eNOFILL, eNOBORDER, eNOBAR, eSLIDER, eIMAGE,
eBACKDROP, eVERTICAL, eHORIZONTAL, eNOTOUCH, eSETTING
eBACKDROP, eVERTICAL, eHORIZONTAL, eNOTOUCH, eSETTING,
e_PB_TAG_COUNT
};
static const char *pb_options[] = {"invert", "nofill", "noborder, nobar", "slider",
"image", "backdrop", "vertical", "horizontal",
"notouch", "setting", NULL};
static const char *pb_options[e_PB_TAG_COUNT + 1] = {[eINVERT] = "invert",
[eNOFILL] = "nofill", [eNOBORDER] = "noborder", [eNOBAR] = "nobar",
[eSLIDER] = "slider", [eIMAGE] = "image", [eBACKDROP] = "backdrop",
[eVERTICAL] = "vertical", [eHORIZONTAL] = "horizontal",
[eNOTOUCH] = "notouch", [eSETTING] = "setting", [e_PB_TAG_COUNT] = NULL};
int pb_op;
while (curr_param < element->params_count)
@ -1409,7 +1412,7 @@ static int parse_skinvar( struct skin_element *element,
if (!isdefault(get_param(element, 2)))
data->newval = get_param(element, 2)->data.number;
else if (sv_op == 0) /*touch*/
else if (sv_op != 0) /*!touch*/
return WPS_ERROR_INVALID_PARAM;
data->max = 0;
if (sv_op == 1) /*set*/