Handle windows paths: mostly change tests for relative, and some other tweaks.

--HG--
branch : WINDOWSPORT
This commit is contained in:
Jean-Francois Dockes
2015-08-31 17:20:04 +02:00
parent 3aeffea387
commit 94da56aadc
12 changed files with 46 additions and 19 deletions
+2 -2
View File
@@ -258,7 +258,7 @@ static bool matchesSkipped(const vector<string>& tdl,
string canonpath = path_canon(path);
string mpath = canonpath;
string topdir;
while (mpath.length() > 1) {
while (!path_isroot(mpath)) { // we assume root not in skipped paths.
for (vector<string>::const_iterator it = tdl.begin();
it != tdl.end(); it++) {
// the topdirs members are already canonized.
@@ -280,7 +280,7 @@ static bool matchesSkipped(const vector<string>& tdl,
mpath = path_getfather(mpath);
// getfather normally returns a path ending with /, canonic
// paths don't (except for '/' itself).
if (!mpath.empty() && mpath[mpath.size()-1] == '/')
if (!path_isroot(mpath) && mpath[mpath.size()-1] == '/')
mpath.erase(mpath.size()-1);
// should not be necessary, but lets be prudent. If the
// path did not shorten, something is seriously amiss
+1 -1
View File
@@ -469,7 +469,7 @@ bool RclFAM::getEvent(RclMonEvent& ev, int msecs)
MONDEB(("RclFAM::getEvent: FAMNextEvent returned\n"));
map<int,string>::const_iterator it;
if ((fe.filename[0] != '/') &&
if ((!path_isabsolute(fe.filename)) &&
(it = m_idtopath.find(fe.fr.reqnum)) != m_idtopath.end()) {
ev.m_path = path_cat(it->second, fe.filename);
} else {