aboutsummaryrefslogtreecommitdiffstats
path: root/util/folder/dirent_win.c
diff options
context:
space:
mode:
authoraosipenko <aosipenko@yandex-team.ru>2022-02-10 16:48:08 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:08 +0300
commit948fd24d47d4b3b7815aaef1686aea00ef3f4288 (patch)
tree8ad4c39c2a5f8b341bc02e3b0c5e8f26c40373cb /util/folder/dirent_win.c
parentd2eb4aae699fa2f6901bf32d22eec019c8f29838 (diff)
downloadydb-948fd24d47d4b3b7815aaef1686aea00ef3f4288.tar.gz
Restoring authorship annotation for <aosipenko@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/folder/dirent_win.c')
-rw-r--r--util/folder/dirent_win.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/util/folder/dirent_win.c b/util/folder/dirent_win.c
index 7e6db74ce5..b945630eaa 100644
--- a/util/folder/dirent_win.c
+++ b/util/folder/dirent_win.c
@@ -21,13 +21,13 @@ static void SetErrno() {
struct DIR* opendir(const char* dirname) {
struct DIR* dir = (struct DIR*)malloc(sizeof(struct DIR));
- if (!dir) {
- return NULL;
+ if (!dir) {
+ return NULL;
}
- dir->sh = INVALID_HANDLE_VALUE;
- dir->fff_templ = NULL;
- dir->file_no = 0;
- dir->readdir_buf = NULL;
+ dir->sh = INVALID_HANDLE_VALUE;
+ dir->fff_templ = NULL;
+ dir->file_no = 0;
+ dir->readdir_buf = NULL;
int len = strlen(dirname);
//Remove trailing slashes
@@ -36,31 +36,31 @@ struct DIR* opendir(const char* dirname) {
}
int len_converted = MultiByteToWideChar(CP_UTF8, 0, dirname, len, 0, 0);
if (len_converted == 0) {
- closedir(dir);
- return NULL;
+ closedir(dir);
+ return NULL;
}
dir->fff_templ = (WCHAR*)malloc((len_converted + 5) * sizeof(WCHAR));
- if (!dir->fff_templ) {
- closedir(dir);
- return NULL;
+ if (!dir->fff_templ) {
+ closedir(dir);
+ return NULL;
}
MultiByteToWideChar(CP_UTF8, 0, dirname, len, dir->fff_templ, len_converted);
WCHAR append[] = {'\\', '*', '.', '*', 0};
memcpy(dir->fff_templ + len_converted, append, sizeof(append));
dir->sh = FindFirstFileW(dir->fff_templ, &dir->wfd);
- if (dir->sh == INVALID_HANDLE_VALUE) {
+ if (dir->sh == INVALID_HANDLE_VALUE) {
SetErrno();
- closedir(dir);
- return NULL;
+ closedir(dir);
+ return NULL;
}
-
+
return dir;
}
int closedir(struct DIR* dir) {
- if (dir->sh != INVALID_HANDLE_VALUE)
- FindClose(dir->sh);
+ if (dir->sh != INVALID_HANDLE_VALUE)
+ FindClose(dir->sh);
free(dir->fff_templ);
free(dir->readdir_buf);
free(dir);