From d348615dee579c0b3ea6a24e51e528239b5c4cea Mon Sep 17 00:00:00 2001 From: Miika Pekkarinen Date: Thu, 23 Jun 2011 21:27:08 +0000 Subject: Fixed a regression caused in r30021: tagnavi_custom.config parsing fails if lines ended with sequence. git-svn-id: svn://svn.rockbox.org/rockbox/branches/v3_9@30059 a1c6a512-1295-4272-9138-f99709370657 --- apps/misc.c | 2 +- apps/misc.h | 2 +- apps/tagcache.c | 2 +- apps/tagtree.c | 8 +++++++- 4 files changed, 10 insertions(+), 4 deletions(-) (limited to 'apps') diff --git a/apps/misc.c b/apps/misc.c index 68775b36f5..1f945c5431 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -170,7 +170,7 @@ bool warn_on_pl_erase(void) /* Performance optimized version of the read_line() (see below) function. */ int fast_readline(int fd, char *buf, int buf_size, void *parameters, - int (*callback)(int n, const char *buf, void *parameters)) + int (*callback)(int n, char *buf, void *parameters)) { char *p, *next; int rc, pos = 0; diff --git a/apps/misc.h b/apps/misc.h index 0fd408b941..0b155db1ec 100644 --- a/apps/misc.h +++ b/apps/misc.h @@ -57,7 +57,7 @@ bool warn_on_pl_erase(void); */ int read_line(int fd, char* buffer, int buffer_size); int fast_readline(int fd, char *buf, int buf_size, void *parameters, - int (*callback)(int n, const char *buf, void *parameters)); + int (*callback)(int n, char *buf, void *parameters)); bool settings_parseline(char* line, char** name, char** value); long default_event_handler_ex(long event, void (*callback)(void *), void *parameter); diff --git a/apps/tagcache.c b/apps/tagcache.c index 0c85fc5957..f734b4b444 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -3373,7 +3373,7 @@ static bool read_tag(char *dest, long size, return false; } -static int parse_changelog_line(int line_n, const char *buf, void *parameters) +static int parse_changelog_line(int line_n, char *buf, void *parameters) { struct index_entry idx; char tag_data[TAG_MAXLEN+32]; diff --git a/apps/tagtree.c b/apps/tagtree.c index 9451387a66..1fb05b494c 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c @@ -836,15 +836,21 @@ bool tagtree_import(void) static bool parse_menu(const char *filename); -static int parse_line(int n, const char *buf, void *parameters) +static int parse_line(int n, char *buf, void *parameters) { char data[256]; int variable; static bool read_menu; int i; + char *p; (void)parameters; + /* Strip possible at end of line. */ + p = strchr(buf, '\r'); + if (p != NULL) + *p = '\0'; + logf("parse:%d/%s", n, buf); /* First line, do initialisation. */ -- cgit v1.2.3