diff options
author | Marius Kintel <marius@kintel.net> | 2013-05-26 19:08:23 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-05-26 19:08:23 (GMT) |
commit | ce11fb2ea2d9b6865fbdb0fc6b31f7cf8a98e11b (patch) | |
tree | 7c3bffce75fdf5f7c4c8558977b7405e5e000e9b /src/parsersettings.cc | |
parent | da970b5cc067baeb0edee59ba791e14a7fbfb4c6 (diff) |
Fixed remaining issue. We now correctly detect removal of files as changes. Removed temporary debug output. Fixes #364
Diffstat (limited to 'src/parsersettings.cc')
-rw-r--r-- | src/parsersettings.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/parsersettings.cc b/src/parsersettings.cc index 1f95719..8924eb4 100644 --- a/src/parsersettings.cc +++ b/src/parsersettings.cc @@ -25,26 +25,25 @@ fs::path search_libs(const fs::path &localpath) BOOST_FOREACH(const std::string &dir, librarypath) { fs::path usepath = fs::path(dir) / localpath; if (fs::exists(usepath) && !fs::is_directory(usepath)) { - PRINTB("found %s in %s", localpath.string() % dir); return usepath.string(); } } return fs::path(); } -// files must be 'ordinary' - they mus exist and be non-directories +// files must be 'ordinary' - they must exist and be non-directories static bool check_valid(const fs::path &p, const std::vector<std::string> *openfilenames) { if (p.empty()) { - PRINTB("WARNING: %s invalid - file path is blank",p); + PRINTB("WARNING: File path is blank: %s",p); return false; } if (!p.has_parent_path()) { - PRINTB("WARNING: %s invalid - no parent path",p); + PRINTB("WARNING: No parent path: %s",p); return false; } if (!fs::exists(p)) { - PRINTB("WARNING: %s invalid - file not found",p); + PRINTB("WARNING: File not found: %s",p); // searched === return false; } @@ -57,7 +56,7 @@ static bool check_valid(const fs::path &p, const std::vector<std::string> *openf if (openfilenames) { BOOST_FOREACH(const std::string &s, *openfilenames) { if (s == fullname) { - PRINTB("WARNING: circular include with %s", fullname); + PRINTB("WARNING: circular include file %s", fullname); return false; } } @@ -78,7 +77,7 @@ fs::path find_valid_path(const fs::path &sourcepath, fs::path fpath = sourcepath / localpath; if (check_valid(fpath, openfilenames)) return fpath; fpath = search_libs(localpath); - if (check_valid(fpath, openfilenames)) return fpath; + if (!fpath.empty() && check_valid(fpath, openfilenames)) return fpath; } return fs::path(); } |