From c256e5a766f673797a505727a8437ce78fd0dcdf Mon Sep 17 00:00:00 2001 From: albeu Date: Mon, 25 Feb 2002 11:13:34 +0000 Subject: [PATCH] Small bugfix with getting playlist last line. Thx Atmos git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4858 b3059339-0415-0410-9bf9-f77b7e298cf2 --- playtreeparser.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/playtreeparser.c b/playtreeparser.c index 83146d7e10..64a14a395a 100644 --- a/playtreeparser.c +++ b/playtreeparser.c @@ -73,7 +73,7 @@ play_tree_parser_get_line(play_tree_parser_t* p) { end = strchr(p->iter,'\n'); if(!end) { if(p->stream->eof) { - end = p->buffer + p->buffer_end + 1; + end = p->buffer + p->buffer_end; break; } resize = 1; @@ -88,13 +88,13 @@ play_tree_parser_get_line(play_tree_parser_t* p) { return NULL; strncpy(p->line,p->iter,line_end - p->iter); p->line[line_end - p->iter] = '\0'; - end++; + if(end != '\0') + end++; if(!p->keep) { - if(end[1] != '\0') { - p->buffer_end = strlen(end); + if(end[0] != '\0') { + p->buffer_end -= strlen(p->line)+1; memmove(p->buffer,end,p->buffer_end); - p->buffer[p->buffer_end] = '\0'; } else p->buffer_end = 0; p->iter = p->buffer;