aboutsummaryrefslogtreecommitdiffstats
path: root/src/fs/io/BufferedReader.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-01-21 23:43:32 +0100
committerMax Kellermann <max@duempel.org>2015-01-21 23:43:32 +0100
commit6cdb2a48961dd606f255bc19bedde79af0bc1d2c (patch)
treeeaac8b58aa08f787e032ac9fe9ea73b896493ee3 /src/fs/io/BufferedReader.cxx
parentd8bef3270d362c289e89fcb26c91dd6713da1941 (diff)
downloadmpd-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.cxx5
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;
}