mirror of
https://github.com/mpv-player/mpv
synced 2024-12-24 15:52:25 +00:00
Small bugfix with getting playlist last line.
Thx Atmos git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4858 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
cfcf2257be
commit
c256e5a766
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user