diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/gui/gwps-common.c | 15 | ||||
-rw-r--r-- | apps/gui/wps_parser.c | 18 |
2 files changed, 17 insertions, 16 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index 42ba17ad11..62a068f21d 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c | |||
@@ -60,21 +60,6 @@ | |||
60 | /* 3% of 30min file == 54s step size */ | 60 | /* 3% of 30min file == 54s step size */ |
61 | #define MIN_FF_REWIND_STEP 500 | 61 | #define MIN_FF_REWIND_STEP 500 |
62 | 62 | ||
63 | #if 0 | ||
64 | /* Skip leading UTF-8 BOM, if present. */ | ||
65 | static char* skip_utf8_bom(char* buf) | ||
66 | { | ||
67 | unsigned char* s = (unsigned char*) buf; | ||
68 | |||
69 | if(s[0] == 0xef && s[1] == 0xbb && s[2] == 0xbf) | ||
70 | { | ||
71 | buf += 3; | ||
72 | } | ||
73 | |||
74 | return buf; | ||
75 | } | ||
76 | #endif | ||
77 | |||
78 | /* draws the statusbar on the given wps-screen */ | 63 | /* draws the statusbar on the given wps-screen */ |
79 | #ifdef HAVE_LCD_BITMAP | 64 | #ifdef HAVE_LCD_BITMAP |
80 | void gui_wps_statusbar_draw(struct gui_wps *wps, bool force) | 65 | void gui_wps_statusbar_draw(struct gui_wps *wps, bool force) |
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c index b2969ecb34..3a85b5fad5 100644 --- a/apps/gui/wps_parser.c +++ b/apps/gui/wps_parser.c | |||
@@ -671,7 +671,7 @@ static bool wps_parse(struct wps_data *data, const char *wps_bufptr) | |||
671 | char *current_string = data->string_buffer; | 671 | char *current_string = data->string_buffer; |
672 | 672 | ||
673 | while(*wps_bufptr && data->num_tokens < WPS_MAX_TOKENS - 1 | 673 | while(*wps_bufptr && data->num_tokens < WPS_MAX_TOKENS - 1 |
674 | && data->num_lines < WPS_MAX_LINES) | 674 | && data->num_lines < WPS_MAX_LINES) |
675 | { | 675 | { |
676 | switch(*wps_bufptr++) | 676 | switch(*wps_bufptr++) |
677 | { | 677 | { |
@@ -906,6 +906,19 @@ static void load_wps_bitmaps(struct wps_data *wps_data, char *bmpdir) | |||
906 | 906 | ||
907 | #endif /* HAVE_LCD_BITMAP */ | 907 | #endif /* HAVE_LCD_BITMAP */ |
908 | 908 | ||
909 | /* Skip leading UTF-8 BOM, if present. */ | ||
910 | static char *skip_utf8_bom(char *buf) | ||
911 | { | ||
912 | unsigned char *s = (unsigned char *)buf; | ||
913 | |||
914 | if(s[0] == 0xef && s[1] == 0xbb && s[2] == 0xbf) | ||
915 | { | ||
916 | buf += 3; | ||
917 | } | ||
918 | |||
919 | return buf; | ||
920 | } | ||
921 | |||
909 | /* to setup up the wps-data from a format-buffer (isfile = false) | 922 | /* to setup up the wps-data from a format-buffer (isfile = false) |
910 | from a (wps-)file (isfile = true)*/ | 923 | from a (wps-)file (isfile = true)*/ |
911 | bool wps_data_load(struct wps_data *wps_data, | 924 | bool wps_data_load(struct wps_data *wps_data, |
@@ -975,6 +988,9 @@ bool wps_data_load(struct wps_data *wps_data, | |||
975 | clear_bmp_names(); | 988 | clear_bmp_names(); |
976 | #endif | 989 | #endif |
977 | 990 | ||
991 | /* Skip leading UTF-8 BOM, if present. */ | ||
992 | wps_buffer = skip_utf8_bom(wps_buffer); | ||
993 | |||
978 | /* parse the WPS source */ | 994 | /* parse the WPS source */ |
979 | if (!wps_parse(wps_data, wps_buffer)) | 995 | if (!wps_parse(wps_data, wps_buffer)) |
980 | return false; | 996 | return false; |