aboutsummaryrefslogtreecommitdiffstats
path: root/util/folder
diff options
context:
space:
mode:
authortobo <tobo@yandex-team.ru>2022-02-10 16:47:27 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:27 +0300
commit7fe839092527589b38f014d854c51565b3c1adfa (patch)
tree309e97022d3530044b712b8f71318c78faf7856e /util/folder
parentd0d68c395c10da4cb56a1c845504570a04d7893e (diff)
downloadydb-7fe839092527589b38f014d854c51565b3c1adfa.tar.gz
Restoring authorship annotation for <tobo@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/folder')
-rw-r--r--util/folder/dirut.cpp36
-rw-r--r--util/folder/filelist.cpp2
-rw-r--r--util/folder/fts.cpp2
-rw-r--r--util/folder/path.cpp4
-rw-r--r--util/folder/pathsplit.cpp12
-rw-r--r--util/folder/pathsplit.h4
6 files changed, 30 insertions, 30 deletions
diff --git a/util/folder/dirut.cpp b/util/folder/dirut.cpp
index ffc9b09f96..e939217037 100644
--- a/util/folder/dirut.cpp
+++ b/util/folder/dirut.cpp
@@ -87,29 +87,29 @@ bool resolvepath(TString& folder, const TString& home) {
break;
} else {
memmove(pp + j, pp + j + 1, (i - j - 1) * sizeof(p));
- --i;
+ --i;
}
} else if (strcmp(p, "..") == 0) {
if (j == i - 1) {
if (j == 1) {
p = "";
} else {
- --i;
+ --i;
pp[j - 1] = "";
}
break;
} else {
if (j == 1) {
memmove(pp + j, pp + j + 1, (i - j - 1) * sizeof(p));
- --i;
+ --i;
} else {
memmove(pp + j - 1, pp + j + 1, (i - j - 1) * sizeof(p));
i -= 2;
- --j;
+ --j;
}
}
} else
- ++j;
+ ++j;
}
char* s = newpath;
@@ -144,10 +144,10 @@ static int next_dir(T*& ptr) {
int c = (unsigned char)*ptr++;
switch (c) {
case ' ':
- ++has_blank;
+ ++has_blank;
break;
case '.':
- ++has_dot;
+ ++has_dot;
break;
case '/':
case ':':
@@ -157,17 +157,17 @@ static int next_dir(T*& ptr) {
case '<':
case '>':
case '|':
- ++has_ctrl;
+ ++has_ctrl;
break;
default:
if (c == 127 || c < ' ')
- ++has_ctrl;
+ ++has_ctrl;
else
- ++has_letter;
+ ++has_letter;
}
}
if (*ptr)
- ++ptr;
+ ++ptr;
if (has_ctrl)
return dt_error;
if (has_letter)
@@ -208,7 +208,7 @@ static int skip_disk(T*& ptr) {
ptr += 2;
}
if (*ptr == '\\' || *ptr == '/') {
- ++ptr;
+ ++ptr;
result |= dk_fromroot;
}
}
@@ -228,14 +228,14 @@ int correctpath(char* cpath, const char* path) {
if (c == '/')
c = '\\';
if (c == '\\')
- ++counter;
+ ++counter;
else
counter = 0;
if (counter <= 1) {
*cptr = c;
- ++cptr;
+ ++cptr;
}
- ++ptr;
+ ++ptr;
}
*cptr = 0;
// replace '/' by '\'
@@ -249,21 +249,21 @@ int correctpath(char* cpath, const char* path) {
while (*ptr) {
switch (next_dir(ptr)) {
case dt_dir:
- ++level;
+ ++level;
break;
case dt_empty:
memmove(ptr1, ptr, strlen(ptr) + 1);
ptr = ptr1;
break;
case dt_up:
- --level;
+ --level;
if (level >= 0) {
*--ptr1 = 0;
ptr1 = strrchr(cpath, '\\');
if (!ptr1)
ptr1 = cpath;
else
- ++ptr1;
+ ++ptr1;
memmove(ptr1, ptr, strlen(ptr) + 1);
ptr = ptr1;
break;
diff --git a/util/folder/filelist.cpp b/util/folder/filelist.cpp
index b21fcdbf20..5872a9c9c0 100644
--- a/util/folder/filelist.cpp
+++ b/util/folder/filelist.cpp
@@ -16,7 +16,7 @@ void TFileEntitiesList::Fill(const TString& dirname, TStringBuf prefix, TStringB
size_t dirNameLength = dirname.length();
while (dirNameLength && (dirname[dirNameLength - 1] == '\\' || dirname[dirNameLength - 1] == '/')) {
- --dirNameLength;
+ --dirNameLength;
}
for (auto file = dir.begin(); file != dir.end(); ++file) {
diff --git a/util/folder/fts.cpp b/util/folder/fts.cpp
index 0e6a6f86eb..326c37ef13 100644
--- a/util/folder/fts.cpp
+++ b/util/folder/fts.cpp
@@ -902,7 +902,7 @@ fts_build(FTS* sp, int type)
/* GCC, you're too verbose. */
cp = nullptr;
}
- ++len;
+ ++len;
maxlen = sp->fts_pathlen - len;
level = cur->fts_level + 1;
diff --git a/util/folder/path.cpp b/util/folder/path.cpp
index bfe0c67d68..1f1f27aedc 100644
--- a/util/folder/path.cpp
+++ b/util/folder/path.cpp
@@ -17,7 +17,7 @@ struct TFsPath::TSplit: public TAtomicRefCount<TSplit>, public TPathSplit {
void TFsPath::CheckDefined() const {
if (!IsDefined()) {
- ythrow TIoException() << TStringBuf("must be defined");
+ ythrow TIoException() << TStringBuf("must be defined");
}
}
@@ -83,7 +83,7 @@ TFsPath TFsPath::RelativePath(const TFsPath& root) const {
size_t cnt = 0;
while (split.size() > cnt && rsplit.size() > cnt && split[cnt] == rsplit[cnt]) {
- ++cnt;
+ ++cnt;
}
bool absboth = split.IsAbsolute && rsplit.IsAbsolute;
if (cnt == 0 && !absboth) {
diff --git a/util/folder/pathsplit.cpp b/util/folder/pathsplit.cpp
index 81d439a727..cb2340bbc6 100644
--- a/util/folder/pathsplit.cpp
+++ b/util/folder/pathsplit.cpp
@@ -17,8 +17,8 @@ static inline size_t ToReserve(const T& t) {
}
void TPathSplitTraitsUnix::DoParseFirstPart(const TStringBuf part) {
- if (part == TStringBuf(".")) {
- push_back(TStringBuf("."));
+ if (part == TStringBuf(".")) {
+ push_back(TStringBuf("."));
return;
}
@@ -46,8 +46,8 @@ void TPathSplitTraitsUnix::DoParsePart(const TStringBuf part0) {
void TPathSplitTraitsWindows::DoParseFirstPart(const TStringBuf part0) {
TStringBuf part(part0);
- if (part == TStringBuf(".")) {
- push_back(TStringBuf("."));
+ if (part == TStringBuf(".")) {
+ push_back(TStringBuf("."));
return;
}
@@ -107,9 +107,9 @@ TString TPathSplitStore::DoReconstruct(const TStringBuf slash) const {
}
void TPathSplitStore::AppendComponent(const TStringBuf comp) {
- if (!comp || comp == TStringBuf(".")) {
+ if (!comp || comp == TStringBuf(".")) {
; // ignore
- } else if (comp == TStringBuf("..") && !empty() && back() != TStringBuf("..")) {
+ } else if (comp == TStringBuf("..") && !empty() && back() != TStringBuf("..")) {
pop_back();
} else {
// push back first .. also
diff --git a/util/folder/pathsplit.h b/util/folder/pathsplit.h
index d134338e35..8d893f6eac 100644
--- a/util/folder/pathsplit.h
+++ b/util/folder/pathsplit.h
@@ -25,7 +25,7 @@ struct TPathSplitTraitsUnix: public TPathSplitStore {
static constexpr char MainPathSep = '/';
inline TString Reconstruct() const {
- return DoReconstruct(TStringBuf("/"));
+ return DoReconstruct(TStringBuf("/"));
}
static constexpr bool IsPathSep(const char c) noexcept {
@@ -44,7 +44,7 @@ struct TPathSplitTraitsWindows: public TPathSplitStore {
static constexpr char MainPathSep = '\\';
inline TString Reconstruct() const {
- return DoReconstruct(TStringBuf("\\"));
+ return DoReconstruct(TStringBuf("\\"));
}
static constexpr bool IsPathSep(char c) noexcept {