don't count eof as truncated
authorEvan Martin <martine@danga.com>
Sat, 27 Apr 2013 21:37:26 +0000 (14:37 -0700)
committerEvan Martin <martine@danga.com>
Sat, 27 Apr 2013 21:37:26 +0000 (14:37 -0700)
src/deps_log.cc

index eb1ea2b..c52503b 100644 (file)
@@ -159,7 +159,8 @@ bool DepsLog::Load(const string& path, State* state, string* err) {
 
     uint16_t size;
     if (fread(&size, 2, 1, f) < 1) {
-      read_failed = true;
+      if (!feof(f))
+        read_failed = true;
       break;
     }
     bool is_deps = (size >> 15) != 0;