Skip to content

Commit

Permalink
Try harder to make Dirs end with '/'
Browse files Browse the repository at this point in the history
  • Loading branch information
Andersbakken committed Sep 21, 2013
1 parent 569520f commit 9149c1d
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions rct/Path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,23 +163,28 @@ bool Path::resolve(ResolveMode mode, const Path &cwd)
return true;
}
return false;
} else {
if (!cwd.isEmpty() && !isAbsolute()) {
Path copy = cwd + '/' + *this;
if (copy.resolve(RealPath)) {
operator=(copy);
return true;
}
}

if (!cwd.isEmpty() && !isAbsolute()) {
Path copy = cwd + '/' + *this;
if (copy.resolve(RealPath)) {
operator=(copy);
return true;
}
}

{
char buffer[PATH_MAX + 2];
if (realpath(constData(), buffer)) {
String::operator=(buffer);
return true;
{
char buffer[PATH_MAX + 2];
if (realpath(constData(), buffer)) {
if (isDir()) {
assert(buffer[strlen(buffer)] != '/');
buffer[strlen(buffer)] = '/';
}
String::operator=(buffer);
return true;
}
}

return false;
}

Expand Down

0 comments on commit 9149c1d

Please sign in to comment.