diff options
| author | Miika Pekkarinen <miipekk@ihme.org> | 2011-06-23 20:22:00 +0000 |
|---|---|---|
| committer | Miika Pekkarinen <miipekk@ihme.org> | 2011-06-23 20:22:00 +0000 |
| commit | d0084ffd7a4a8f14aeb2c702de5794e36ffff6e8 (patch) | |
| tree | aba59da5a367fb2b00ae81c1935e2fb53ff68b57 /apps | |
| parent | 7ba8871d5b6606824df5c732591e50a3c378eb33 (diff) | |
| download | rockbox-d0084ffd7a4a8f14aeb2c702de5794e36ffff6e8.zip rockbox-d0084ffd7a4a8f14aeb2c702de5794e36ffff6e8.tar.gz rockbox-d0084ffd7a4a8f14aeb2c702de5794e36ffff6e8.tar.bz2 rockbox-d0084ffd7a4a8f14aeb2c702de5794e36ffff6e8.tar.xz | |
Fixed a regression caused in r30021: tagnavi_custom.config parsing
fails if lines ended with <CR><LF> sequence.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30058 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/misc.c | 2 | ||||
| -rw-r--r-- | apps/misc.h | 2 | ||||
| -rw-r--r-- | apps/tagcache.c | 2 | ||||
| -rw-r--r-- | apps/tagtree.c | 8 |
4 files changed, 10 insertions, 4 deletions
diff --git a/apps/misc.c b/apps/misc.c index 68775b3..1f945c5 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 0fd408b..0b155db 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 c5a8dcb..f242324 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -3350,7 +3350,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 653fd6b..3df8d9d 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c @@ -852,15 +852,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 <CR> at end of line. */ + p = strchr(buf, '\r'); + if (p != NULL) + *p = '\0'; + logf("parse:%d/%s", n, buf); /* First line, do initialisation. */ |