- // If nothing is left, we have finished
- if (currentpath.size() == 0) {
- resolvedpath = ("/" + resolvedpath);
- failed = false;
- break;
- }
-
- if (this->isSymlink(currentpath)) {
- currentpath = this->readSymlink(currentpath);
- } else {
- // We know last part is not a symlink, so it is resolved
- std::string part1 =
- currentpath.substr(0, currentpath.rfind('/'));
- std::string part2 =
- currentpath.substr(currentpath.rfind('/')+1);
- currentpath = part1;
- if (resolvedpath.size() == 0)
- resolvedpath = part2;
- else
- resolvedpath = part2 + "/" + resolvedpath;
- }
+ // If nothing is left, we have finished
+ if (currentpath.size() == 0) {
+ resolvedpath = ("/" + resolvedpath);
+ failed = false;
+ break;
+ }
+
+ if (this->isSymlink(currentpath)) {
+ currentpath = this->readSymlink(currentpath);
+ } else {
+ // We know last part is not a symlink, so it is resolved
+ std::string part1 =
+ currentpath.substr(0, currentpath.rfind('/'));
+ std::string part2 =
+ currentpath.substr(currentpath.rfind('/')+1);
+ currentpath = part1;
+ if (resolvedpath.size() == 0)
+ resolvedpath = part2;
+ else
+ resolvedpath = part2 + "/" + resolvedpath;
+ }