Rename format.{cc,h} -> util.{cc,h}.
[cumulus.git] / statcache.cc
index 8e48c79..86886c0 100644 (file)
@@ -30,9 +30,9 @@
 #include <map>
 #include <string>
 
-#include "format.h"
 #include "ref.h"
 #include "statcache.h"
+#include "util.h"
 
 using std::list;
 using std::map;
@@ -125,12 +125,13 @@ void StatCache::ReadNext()
     old_checksum = "";
     old_contents.clear();
 
-    /* First, read in the filename.  TODO: Unescaping. */
+    /* First, read in the filename. */
     getline(cache, old_name);
     if (!cache) {
         end_of_cache = true;
         return;
     }
+    old_name = uri_decode(old_name);
 
     /* Start reading in the fields which follow the filename. */
     string field = "";
@@ -173,7 +174,7 @@ void StatCache::ReadNext()
     if (fields.count("inode"))
         old_inode = parse_int(fields["inode"]);
     if (fields.count("size"))
-        old_inode = parse_int(fields["size"]);
+        old_size = parse_int(fields["size"]);
 
     old_checksum = fields["checksum"];