1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Miika Pekkarinen 2011-06-23 20:22:00 +00:00
parent 7ba8871d5b
commit d0084ffd7a
4 changed files with 10 additions and 4 deletions

View file

@ -170,7 +170,7 @@ bool warn_on_pl_erase(void)
/* Performance optimized version of the read_line() (see below) function. */ /* Performance optimized version of the read_line() (see below) function. */
int fast_readline(int fd, char *buf, int buf_size, void *parameters, 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; char *p, *next;
int rc, pos = 0; int rc, pos = 0;

View file

@ -57,7 +57,7 @@ bool warn_on_pl_erase(void);
*/ */
int read_line(int fd, char* buffer, int buffer_size); int read_line(int fd, char* buffer, int buffer_size);
int fast_readline(int fd, char *buf, int buf_size, void *parameters, 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); bool settings_parseline(char* line, char** name, char** value);
long default_event_handler_ex(long event, void (*callback)(void *), void *parameter); long default_event_handler_ex(long event, void (*callback)(void *), void *parameter);

View file

@ -3350,7 +3350,7 @@ static bool read_tag(char *dest, long size,
return false; 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; struct index_entry idx;
char tag_data[TAG_MAXLEN+32]; char tag_data[TAG_MAXLEN+32];

View file

@ -852,15 +852,21 @@ bool tagtree_import(void)
static bool parse_menu(const char *filename); 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]; char data[256];
int variable; int variable;
static bool read_menu; static bool read_menu;
int i; int i;
char *p;
(void)parameters; (void)parameters;
/* Strip possible <CR> at end of line. */
p = strchr(buf, '\r');
if (p != NULL)
*p = '\0';
logf("parse:%d/%s", n, buf); logf("parse:%d/%s", n, buf);
/* First line, do initialisation. */ /* First line, do initialisation. */