X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=statcache.cc;h=099eb708ae3c7a9688cf438fee75e4e4c689376e;hb=18978c991772448ba77d6e11f921f1ab3d0b8fd2;hp=cccbf5bc94a04724cda4a7680419fc1b674e7b38;hpb=edfee67fdfc443b10d92e6e85a93cda0dcc1e680;p=cumulus.git diff --git a/statcache.cc b/statcache.cc index cccbf5b..099eb70 100644 --- a/statcache.cc +++ b/statcache.cc @@ -30,9 +30,9 @@ #include #include -#include "format.h" #include "ref.h" #include "statcache.h" +#include "util.h" using std::list; using std::map; @@ -79,10 +79,13 @@ static int pathcmp(const char *path1, const char *path2) return pathcmp(slash1 + 1, slash2 + 1); } -void StatCache::Open(const char *path, const char *snapshot_name) +void StatCache::Open(const char *path, const char *snapshot_name, + const char *snapshot_scheme) { oldpath = path; oldpath += "/statcache"; + if (snapshot_scheme != NULL) + oldpath = oldpath + "-" + snapshot_scheme; newpath = oldpath + "." + snapshot_name; oldcache = new ifstream(oldpath.c_str()); @@ -125,12 +128,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 = "";