diff options
author | mvel <mvel@yandex-team.ru> | 2022-02-10 16:45:41 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:41 +0300 |
commit | 43f5a35593ebc9f6bcea619bb170394ea7ae468e (patch) | |
tree | e98df59de24d2ef7c77baed9f41e4875a2fef972 /util/folder | |
parent | bd30392c4cc92487950adc375c07adf52da1d592 (diff) | |
download | ydb-43f5a35593ebc9f6bcea619bb170394ea7ae468e.tar.gz |
Restoring authorship annotation for <mvel@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/folder')
-rw-r--r-- | util/folder/filelist.cpp | 14 | ||||
-rw-r--r-- | util/folder/fts.cpp | 10 | ||||
-rw-r--r-- | util/folder/path_ut.cpp | 2 |
3 files changed, 13 insertions, 13 deletions
diff --git a/util/folder/filelist.cpp b/util/folder/filelist.cpp index 89810e64bf..b21fcdbf20 100644 --- a/util/folder/filelist.cpp +++ b/util/folder/filelist.cpp @@ -5,26 +5,26 @@ #include <util/system/defaults.h> void TFileEntitiesList::Fill(const TString& dirname, TStringBuf prefix, TStringBuf suffix, int depth, bool sort) { - TDirIterator::TOptions opts; - opts.SetMaxLevel(depth); + TDirIterator::TOptions opts; + opts.SetMaxLevel(depth); if (sort) { - opts.SetSortByName(); + opts.SetSortByName(); } - TDirIterator dir(dirname, opts); + TDirIterator dir(dirname, opts); Clear(); - size_t dirNameLength = dirname.length(); + size_t dirNameLength = dirname.length(); while (dirNameLength && (dirname[dirNameLength - 1] == '\\' || dirname[dirNameLength - 1] == '/')) { --dirNameLength; } for (auto file = dir.begin(); file != dir.end(); ++file) { - if (file->fts_pathlen == file->fts_namelen || file->fts_pathlen <= dirNameLength) { + if (file->fts_pathlen == file->fts_namelen || file->fts_pathlen <= dirNameLength) { continue; } - TStringBuf filename = file->fts_path + dirNameLength + 1; + TStringBuf filename = file->fts_path + dirNameLength + 1; if (filename.empty() || !filename.StartsWith(prefix) || !filename.EndsWith(suffix)) { continue; diff --git a/util/folder/fts.cpp b/util/folder/fts.cpp index 8f3f10c643..0e6a6f86eb 100644 --- a/util/folder/fts.cpp +++ b/util/folder/fts.cpp @@ -62,7 +62,7 @@ #ifndef _win_ -static const dird invalidDirD = -1; +static const dird invalidDirD = -1; dird get_cwdd() { return open(".", O_RDONLY, 0); @@ -88,7 +88,7 @@ int cmp_dird(dird fd1, dird fd2) { return fd1 - fd2; } -#else // ndef _win_ +#else // ndef _win_ int stat64UTF(const char* path, struct _stat64* _Stat) { int len_converted = MultiByteToWideChar(CP_UTF8, 0, path, -1, 0, 0); @@ -164,7 +164,7 @@ dird get_dird(char* path) { return ret; } -#endif // ndef _win_ +#endif // ndef _win_ #ifdef _win_ #define S_ISDIR(st_mode) ((st_mode & _S_IFMT) == _S_IFDIR) @@ -873,8 +873,8 @@ fts_build(FTS* sp, int type) dirp = nullptr; #ifdef _win_ close_dird(dirpd); - dirpd = invalidDirD; -#else + dirpd = invalidDirD; +#else Y_UNUSED(invalidDirD); #endif } else { diff --git a/util/folder/path_ut.cpp b/util/folder/path_ut.cpp index 65721bd5bb..e6a3451016 100644 --- a/util/folder/path_ut.cpp +++ b/util/folder/path_ut.cpp @@ -200,7 +200,7 @@ Y_UNIT_TEST_SUITE(TFsPathTests) { UNIT_ASSERT_VALUES_EQUAL(testP.GetPath(), "/db/BASE/primus121-025-1380131338/test"); #endif } - + Y_UNIT_TEST(TestSlashesAndBasenameWin) { TFsPath p("\\db\\BASE\\primus121-025-1380131338\\\\"); TFsPath testP = p / "test"; |