From 19868938d4ce4a022459300c0d45d119921fa8f7 Mon Sep 17 00:00:00 2001 From: Nicolas Pennequin Date: Tue, 1 Apr 2008 17:35:48 +0000 Subject: 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 --- apps/gui/wps_parser.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'apps/gui') 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; } -- cgit v1.2.3