summaryrefslogtreecommitdiff
path: root/apps/gui/wps_parser.c
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 /apps/gui/wps_parser.c
parent2e6b28027f1edd12de5d621a78cbc8dc064dade4 (diff)
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
Diffstat (limited to 'apps/gui/wps_parser.c')
-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)
print_debug_info(data, fail, line);
#endif
- if (fail)
- wps_reset(data);
-
return (fail == 0);
}
@@ -1564,8 +1561,10 @@ bool wps_data_load(struct wps_data *wps_data,
wps_buffer = skip_utf8_bom(wps_buffer);
/* parse the WPS source */
- if (!wps_parse(wps_data, wps_buffer))
+ if (!wps_parse(wps_data, wps_buffer)) {
+ wps_reset(wps_data);
return false;
+ }
wps_data->wps_loaded = true;
@@ -1579,8 +1578,10 @@ bool wps_data_load(struct wps_data *wps_data,
bmpdir[bmpdirlen] = 0;
/* load the bitmaps that were found by the parsing */
- if (!load_wps_bitmaps(wps_data, bmpdir))
+ if (!load_wps_bitmaps(wps_data, bmpdir)) {
+ wps_reset(wps_data);
return false;
+ }
#endif
return true;
}