diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/gui/gwps-common.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index cef3745ead..34c3c7876b 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c | |||
@@ -916,6 +916,7 @@ void gui_wps_format(struct wps_data *data, const char *bmpdir, | |||
916 | char* start_of_line = data->format_buffer; | 916 | char* start_of_line = data->format_buffer; |
917 | int line = 0; | 917 | int line = 0; |
918 | int subline; | 918 | int subline; |
919 | char c, lastc; | ||
919 | #ifndef HAVE_LCD_BITMAP | 920 | #ifndef HAVE_LCD_BITMAP |
920 | /* no bitmap lcd == no bitmap loading */ | 921 | /* no bitmap lcd == no bitmap loading */ |
921 | (void)bmpdir; | 922 | (void)bmpdir; |
@@ -945,7 +946,9 @@ void gui_wps_format(struct wps_data *data, const char *bmpdir, | |||
945 | 946 | ||
946 | while ((*buf) && (line < WPS_MAX_LINES)) | 947 | while ((*buf) && (line < WPS_MAX_LINES)) |
947 | { | 948 | { |
948 | switch (*buf) | 949 | c = *buf; |
950 | |||
951 | switch (c) | ||
949 | { | 952 | { |
950 | /* | 953 | /* |
951 | * skip % sequences so "%;" doesn't start a new subline | 954 | * skip % sequences so "%;" doesn't start a new subline |
@@ -1006,6 +1009,10 @@ void gui_wps_format(struct wps_data *data, const char *bmpdir, | |||
1006 | char *pos = NULL; | 1009 | char *pos = NULL; |
1007 | char imgname[MAX_PATH]; | 1010 | char imgname[MAX_PATH]; |
1008 | char qual = *ptr; | 1011 | char qual = *ptr; |
1012 | |||
1013 | if(lastc != '%') | ||
1014 | break; | ||
1015 | |||
1009 | if (qual == 'l' || qual == '|') /* format: | 1016 | if (qual == 'l' || qual == '|') /* format: |
1010 | %x|n|filename.bmp|x|y| | 1017 | %x|n|filename.bmp|x|y| |
1011 | or | 1018 | or |
@@ -1033,7 +1040,14 @@ void gui_wps_format(struct wps_data *data, const char *bmpdir, | |||
1033 | ptr = pos+1; | 1040 | ptr = pos+1; |
1034 | 1041 | ||
1035 | /* check the image number and load state */ | 1042 | /* check the image number and load state */ |
1036 | if (!data->img[n].loaded) | 1043 | if (data->img[n].loaded) |
1044 | { | ||
1045 | /* Skip the rest of the line */ | ||
1046 | while(*buf != '\n') | ||
1047 | buf++; | ||
1048 | break; | ||
1049 | } | ||
1050 | else | ||
1037 | { | 1051 | { |
1038 | /* get filename */ | 1052 | /* get filename */ |
1039 | pos = strchr(ptr, '|'); | 1053 | pos = strchr(ptr, '|'); |
@@ -1100,10 +1114,11 @@ void gui_wps_format(struct wps_data *data, const char *bmpdir, | |||
1100 | } | 1114 | } |
1101 | } | 1115 | } |
1102 | } | 1116 | } |
1103 | } | 1117 | } |
1104 | #endif | 1118 | #endif |
1105 | break; | 1119 | break; |
1106 | } | 1120 | } |
1121 | lastc = c; | ||
1107 | buf++; | 1122 | buf++; |
1108 | } | 1123 | } |
1109 | } | 1124 | } |