summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/wps-display.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/wps-display.c b/apps/wps-display.c
index 2754dba8ad..c6621b1e62 100644
--- a/apps/wps-display.c
+++ b/apps/wps-display.c
@@ -113,6 +113,7 @@ char* wps_get_genre(unsigned int genre)
113static void wps_format(char* fmt) 113static void wps_format(char* fmt)
114{ 114{
115 char* buf = format_buffer; 115 char* buf = format_buffer;
116 char* start_of_line = format_buffer;
116 int line = 0; 117 int line = 0;
117 118
118 strncpy(format_buffer, fmt, sizeof(format_buffer)); 119 strncpy(format_buffer, fmt, sizeof(format_buffer));
@@ -129,11 +130,15 @@ static void wps_format(char* fmt)
129 130
130 case '\n': /* LF */ 131 case '\n': /* LF */
131 *buf = 0; 132 *buf = 0;
133
134 if(*start_of_line != '#') /* A comment? */
135 line++;
132 136
133 if (++line < MAX_LINES) 137 if (line <= MAX_LINES)
134 { 138 {
135 /* the next line starts on the next byte */ 139 /* the next line starts on the next byte */
136 format_lines[line] = buf+1; 140 format_lines[line] = buf+1;
141 start_of_line = format_lines[line];
137 } 142 }
138 break; 143 break;
139 } 144 }