diff options
author | Miika Pekkarinen <miipekk@ihme.org> | 2011-06-23 21:27:08 +0000 |
---|---|---|
committer | Miika Pekkarinen <miipekk@ihme.org> | 2011-06-23 21:27:08 +0000 |
commit | d348615dee579c0b3ea6a24e51e528239b5c4cea (patch) | |
tree | a368f50c122366dc95279f7008c17c0ed3c3df49 | |
parent | 27cdcb61bf7819b0451bbbd6e53f4a8112dd8348 (diff) | |
download | rockbox-d348615dee579c0b3ea6a24e51e528239b5c4cea.tar.gz rockbox-d348615dee579c0b3ea6a24e51e528239b5c4cea.zip |
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/branches/v3_9@30059 a1c6a512-1295-4272-9138-f99709370657
-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 68775b36f5..1f945c5431 100644 --- a/apps/misc.c +++ b/apps/misc.c | |||
@@ -170,7 +170,7 @@ bool warn_on_pl_erase(void) | |||
170 | 170 | ||
171 | /* Performance optimized version of the read_line() (see below) function. */ | 171 | /* Performance optimized version of the read_line() (see below) function. */ |
172 | int fast_readline(int fd, char *buf, int buf_size, void *parameters, | 172 | int fast_readline(int fd, char *buf, int buf_size, void *parameters, |
173 | int (*callback)(int n, const char *buf, void *parameters)) | 173 | int (*callback)(int n, char *buf, void *parameters)) |
174 | { | 174 | { |
175 | char *p, *next; | 175 | char *p, *next; |
176 | int rc, pos = 0; | 176 | 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); | |||
57 | */ | 57 | */ |
58 | int read_line(int fd, char* buffer, int buffer_size); | 58 | int read_line(int fd, char* buffer, int buffer_size); |
59 | int fast_readline(int fd, char *buf, int buf_size, void *parameters, | 59 | int fast_readline(int fd, char *buf, int buf_size, void *parameters, |
60 | int (*callback)(int n, const char *buf, void *parameters)); | 60 | int (*callback)(int n, char *buf, void *parameters)); |
61 | 61 | ||
62 | bool settings_parseline(char* line, char** name, char** value); | 62 | bool settings_parseline(char* line, char** name, char** value); |
63 | long default_event_handler_ex(long event, void (*callback)(void *), void *parameter); | 63 | 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, | |||
3373 | return false; | 3373 | return false; |
3374 | } | 3374 | } |
3375 | 3375 | ||
3376 | static int parse_changelog_line(int line_n, const char *buf, void *parameters) | 3376 | static int parse_changelog_line(int line_n, char *buf, void *parameters) |
3377 | { | 3377 | { |
3378 | struct index_entry idx; | 3378 | struct index_entry idx; |
3379 | char tag_data[TAG_MAXLEN+32]; | 3379 | 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) | |||
836 | 836 | ||
837 | static bool parse_menu(const char *filename); | 837 | static bool parse_menu(const char *filename); |
838 | 838 | ||
839 | static int parse_line(int n, const char *buf, void *parameters) | 839 | static int parse_line(int n, char *buf, void *parameters) |
840 | { | 840 | { |
841 | char data[256]; | 841 | char data[256]; |
842 | int variable; | 842 | int variable; |
843 | static bool read_menu; | 843 | static bool read_menu; |
844 | int i; | 844 | int i; |
845 | char *p; | ||
845 | 846 | ||
846 | (void)parameters; | 847 | (void)parameters; |
847 | 848 | ||
849 | /* Strip possible <CR> at end of line. */ | ||
850 | p = strchr(buf, '\r'); | ||
851 | if (p != NULL) | ||
852 | *p = '\0'; | ||
853 | |||
848 | logf("parse:%d/%s", n, buf); | 854 | logf("parse:%d/%s", n, buf); |
849 | 855 | ||
850 | /* First line, do initialisation. */ | 856 | /* First line, do initialisation. */ |