summaryrefslogtreecommitdiffstats
path: root/src/build_log.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/build_log.cc')
-rw-r--r--src/build_log.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/build_log.cc b/src/build_log.cc
index cd74bd1..c630fbe 100644
--- a/src/build_log.cc
+++ b/src/build_log.cc
@@ -144,8 +144,15 @@ bool BuildLog::Load(const string& path, string* err) {
}
end = strchr(start, ' ');
+ if (!end)
+ continue;
string output = string(start, end - start);
+ start = end + 1;
+ end = strchr(start, '\n');
+ if (!end)
+ continue;
+
LogEntry* entry;
Log::iterator i = log_.find(output);
if (i != log_.end()) {
@@ -160,9 +167,6 @@ bool BuildLog::Load(const string& path, string* err) {
entry->output = output;
entry->start_time = start_time;
entry->end_time = end_time;
-
- start = end + 1;
- end = strchr(start, '\n');
entry->command = string(start, end - start);
}