From c6f234a4ccc917d16b21b89b00700391aaacca51 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Tue, 4 Nov 2003 13:46:37 +0000 Subject: WPS files now supports comments git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4014 a1c6a512-1295-4272-9138-f99709370657 --- apps/wps-display.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'apps') 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) static void wps_format(char* fmt) { char* buf = format_buffer; + char* start_of_line = format_buffer; int line = 0; strncpy(format_buffer, fmt, sizeof(format_buffer)); @@ -129,11 +130,15 @@ static void wps_format(char* fmt) case '\n': /* LF */ *buf = 0; + + if(*start_of_line != '#') /* A comment? */ + line++; - if (++line < MAX_LINES) + if (line <= MAX_LINES) { /* the next line starts on the next byte */ format_lines[line] = buf+1; + start_of_line = format_lines[line]; } break; } -- cgit v1.2.3