mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
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:
parent
7ba8871d5b
commit
d0084ffd7a
4 changed files with 10 additions and 4 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue