From 6a8cee19b3076a7212b5e7460d11e51000456052 Mon Sep 17 00:00:00 2001 From: Jude Taylor Date: Fri, 9 Oct 2015 08:18:48 -0700 Subject: fix line reading in preBuildHook --- src/libstore/build.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 8167fcc726cf..10f926bf8da7 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -2059,7 +2059,7 @@ void DerivationGoal::startBuilder() auto lastPos = std::string::size_type{0}; for (auto nlPos = lines.find('\n'); nlPos != string::npos; nlPos = lines.find('\n', lastPos)) { - auto line = std::string{lines, lastPos, nlPos}; + auto line = std::string{lines, lastPos, nlPos - lastPos}; lastPos = nlPos + 1; if (state == stBegin) { if (line == "extra-chroot-dirs") { -- cgit 1.4.1