summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Pennequin <nicolas.pennequin@free.fr>2008-04-01 17:35:48 +0000
committerNicolas Pennequin <nicolas.pennequin@free.fr>2008-04-01 17:35:48 +0000
commit19868938d4ce4a022459300c0d45d119921fa8f7 (patch)
tree4ef2d93f94b24f01d17a0533c86176d2a3653383
parent2e6b28027f1edd12de5d621a78cbc8dc064dade4 (diff)
downloadrockbox-19868938d4ce4a022459300c0d45d119921fa8f7.tar.gz
rockbox-19868938d4ce4a022459300c0d45d119921fa8f7.zip
WPS parser: also revert to the default WPS when there were bitmap loading errors. The reverting is moved from wps_parse() to wps_data_load().
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16914 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/wps_parser.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c
index f6b21781a2..50020dada6 100644
--- a/apps/gui/wps_parser.c
+++ b/apps/gui/wps_parser.c
@@ -1319,9 +1319,6 @@ static bool wps_parse(struct wps_data *data, const char *wps_bufptr)
1319 print_debug_info(data, fail, line); 1319 print_debug_info(data, fail, line);
1320#endif 1320#endif
1321 1321
1322 if (fail)
1323 wps_reset(data);
1324
1325 return (fail == 0); 1322 return (fail == 0);
1326} 1323}
1327 1324
@@ -1564,8 +1561,10 @@ bool wps_data_load(struct wps_data *wps_data,
1564 wps_buffer = skip_utf8_bom(wps_buffer); 1561 wps_buffer = skip_utf8_bom(wps_buffer);
1565 1562
1566 /* parse the WPS source */ 1563 /* parse the WPS source */
1567 if (!wps_parse(wps_data, wps_buffer)) 1564 if (!wps_parse(wps_data, wps_buffer)) {
1565 wps_reset(wps_data);
1568 return false; 1566 return false;
1567 }
1569 1568
1570 wps_data->wps_loaded = true; 1569 wps_data->wps_loaded = true;
1571 1570
@@ -1579,8 +1578,10 @@ bool wps_data_load(struct wps_data *wps_data,
1579 bmpdir[bmpdirlen] = 0; 1578 bmpdir[bmpdirlen] = 0;
1580 1579
1581 /* load the bitmaps that were found by the parsing */ 1580 /* load the bitmaps that were found by the parsing */
1582 if (!load_wps_bitmaps(wps_data, bmpdir)) 1581 if (!load_wps_bitmaps(wps_data, bmpdir)) {
1582 wps_reset(wps_data);
1583 return false; 1583 return false;
1584 }
1584#endif 1585#endif
1585 return true; 1586 return true;
1586 } 1587 }