diff options
author | Max Kellermann <max@duempel.org> | 2015-01-21 23:43:32 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-01-21 23:43:32 +0100 |
commit | 6cdb2a48961dd606f255bc19bedde79af0bc1d2c (patch) | |
tree | eaac8b58aa08f787e032ac9fe9ea73b896493ee3 /src/fs/io/BufferedReader.cxx | |
parent | d8bef3270d362c289e89fcb26c91dd6713da1941 (diff) | |
download | mpd-6cdb2a48961dd606f255bc19bedde79af0bc1d2c.tar.gz mpd-6cdb2a48961dd606f255bc19bedde79af0bc1d2c.tar.xz mpd-6cdb2a48961dd606f255bc19bedde79af0bc1d2c.zip |
fs/io/BufferedReader: count line numbers
Replaces the dirty code in config/ConfigFile.cxx.
Diffstat (limited to 'src/fs/io/BufferedReader.cxx')
-rw-r--r-- | src/fs/io/BufferedReader.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fs/io/BufferedReader.cxx b/src/fs/io/BufferedReader.cxx index 01b7b0cf0..9a296d815 100644 --- a/src/fs/io/BufferedReader.cxx +++ b/src/fs/io/BufferedReader.cxx @@ -59,8 +59,10 @@ BufferedReader::ReadLine() { do { char *line = ReadBufferedLine(buffer); - if (line != nullptr) + if (line != nullptr) { + ++line_number; return line; + } } while (Fill(true)); if (last_error.IsDefined() || !eof || buffer.IsEmpty()) @@ -78,5 +80,6 @@ BufferedReader::ReadLine() char *line = buffer.Read().data; buffer.Clear(); + ++line_number; return line; } |