aboutsummaryrefslogtreecommitdiffstats
path: root/util/folder/path.cpp
diff options
context:
space:
mode:
authorkakabba <kakabba@yandex-team.ru>2022-02-10 16:46:04 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:04 +0300
commitc8e3995898c443e78266f7420aac5fb3da15d413 (patch)
treea530e068cc107e227deccc80722204db63a4d75d /util/folder/path.cpp
parent110a978b66fe6c0916572df51cfead2a9b647174 (diff)
downloadydb-c8e3995898c443e78266f7420aac5fb3da15d413.tar.gz
Restoring authorship annotation for <kakabba@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/folder/path.cpp')
-rw-r--r--util/folder/path.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/util/folder/path.cpp b/util/folder/path.cpp
index bfe0c67d68..c8f440d669 100644
--- a/util/folder/path.cpp
+++ b/util/folder/path.cpp
@@ -77,29 +77,29 @@ TFsPath TFsPath::RelativeTo(const TFsPath& root) const {
return TFsPath(split.Reconstruct());
}
-TFsPath TFsPath::RelativePath(const TFsPath& root) const {
- TSplit split = GetSplit();
- const TSplit& rsplit = root.GetSplit();
- size_t cnt = 0;
+TFsPath TFsPath::RelativePath(const TFsPath& root) const {
+ TSplit split = GetSplit();
+ const TSplit& rsplit = root.GetSplit();
+ size_t cnt = 0;
while (split.size() > cnt && rsplit.size() > cnt && split[cnt] == rsplit[cnt]) {
++cnt;
}
bool absboth = split.IsAbsolute && rsplit.IsAbsolute;
if (cnt == 0 && !absboth) {
- ythrow TIoException() << "No common parts in " << *this << " and " << root;
+ ythrow TIoException() << "No common parts in " << *this << " and " << root;
}
TString r;
for (size_t i = 0; i < rsplit.size() - cnt; i++) {
- r += i == 0 ? ".." : "/..";
+ r += i == 0 ? ".." : "/..";
}
for (size_t i = cnt; i < split.size(); i++) {
r += (i == 0 || i == cnt && rsplit.size() - cnt == 0 ? "" : "/");
r += split[i];
}
return r.size() ? TFsPath(r) : TFsPath();
-}
-
+}
+
TFsPath TFsPath::Parent() const {
if (!IsDefined()) {
return TFsPath();
@@ -314,11 +314,11 @@ TFsPath TFsPath::RealPath() const {
return ::RealPath(*this);
}
-TFsPath TFsPath::RealLocation() const {
- CheckDefined();
+TFsPath TFsPath::RealLocation() const {
+ CheckDefined();
return ::RealLocation(*this);
-}
-
+}
+
TFsPath TFsPath::ReadLink() const {
CheckDefined();