Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
217d88f2
Commit
217d88f2
authored
Oct 28, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TextInputStream: don't ignore unterminated last line
parent
394e3be4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
NEWS
NEWS
+1
-0
TextInputStream.cxx
src/input/TextInputStream.cxx
+16
-4
No files found.
NEWS
View file @
217d88f2
ver 0.19.2 (not yet released)
ver 0.19.2 (not yet released)
* playlist
* playlist
- m3u: don't ignore unterminated last line
- m3u: recognize the file suffix ".m3u8"
- m3u: recognize the file suffix ".m3u8"
* decoder
* decoder
- faad: remove workaround for ancient libfaad2 ABI bug
- faad: remove workaround for ancient libfaad2 ABI bug
...
...
src/input/TextInputStream.cxx
View file @
217d88f2
...
@@ -38,8 +38,8 @@ TextInputStream::ReadLine()
...
@@ -38,8 +38,8 @@ TextInputStream::ReadLine()
while
(
true
)
{
while
(
true
)
{
auto
dest
=
buffer
.
Write
();
auto
dest
=
buffer
.
Write
();
if
(
dest
.
size
<
2
)
{
if
(
dest
.
size
<
2
)
{
/*
end of file (or line too long): terminate
/*
line too long: terminate the current
the current
line */
line */
assert
(
!
dest
.
IsEmpty
());
assert
(
!
dest
.
IsEmpty
());
dest
[
0
]
=
0
;
dest
[
0
]
=
0
;
...
@@ -66,7 +66,19 @@ TextInputStream::ReadLine()
...
@@ -66,7 +66,19 @@ TextInputStream::ReadLine()
if
(
line
!=
nullptr
)
if
(
line
!=
nullptr
)
return
line
;
return
line
;
if
(
nbytes
==
0
)
if
(
nbytes
==
0
)
{
return
nullptr
;
/* end of file: see if there's an unterminated
line */
dest
=
buffer
.
Write
();
assert
(
!
dest
.
IsEmpty
());
dest
[
0
]
=
0
;
auto
r
=
buffer
.
Read
();
buffer
.
Clear
();
return
r
.
IsEmpty
()
?
nullptr
:
r
.
data
;
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment