From 3f40c740e2044ff232b5027c00a17cce8c3ce66b Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Thu, 12 Apr 2012 17:26:56 +0200 Subject: [PATCH] Make vjson look in the local file system if it can't find it in the VFS. --- ext/vjson/json.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ext/vjson/json.cpp b/ext/vjson/json.cpp index cc6dfd5ed7..81dea38070 100644 --- a/ext/vjson/json.cpp +++ b/ext/vjson/json.cpp @@ -3,6 +3,8 @@ #include #include "json.h" #include "file/easy_file.h" +#include "file/zip_read.h" +#include "file/vfs.h" // true if character represent a digit #define IS_DIGIT(c) (c >= '0' && c <= '9') @@ -615,6 +617,12 @@ JsonReader::JsonReader(const std::string &filename) : alloc_(1 << 12), root_(0) if (buffer_) { parse(); } else { - ELOG("Failed to read json %s", filename.c_str()); + // Okay, try to read on the local file system + buffer_ = (char *)ReadLocalFile(filename.c_str(), &buf_size); + if (buffer_) { + parse(); + } else { + ELOG("Failed to read json %s", filename.c_str()); + } } }