Skip to content

Commit fbe2d85

Browse files
huseyinacacak-janeasaghul
authored andcommitted
win,fs: remove trailing slash in junctions
Fixes: #3329
1 parent be0b00a commit fbe2d85

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

src/win/fs.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2566,7 +2566,6 @@ static void fs__create_junction(uv_fs_t* req, const WCHAR* path,
25662566

25672567
path_buf[path_buf_len++] = path[i];
25682568
}
2569-
path_buf[path_buf_len++] = L'\\';
25702569
len = path_buf_len - start;
25712570

25722571
/* Set the info about the substitute name */

test/test-fs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2379,8 +2379,8 @@ int test_symlink_dir_impl(int type) {
23792379
strcpy(test_dir_abs_buf, "\\\\?\\");
23802380
uv_cwd(test_dir_abs_buf + 4, &test_dir_abs_size);
23812381
test_dir_abs_size += 4;
2382-
strcat(test_dir_abs_buf, "\\test_dir\\");
2383-
test_dir_abs_size += strlen("\\test_dir\\");
2382+
strcat(test_dir_abs_buf, "\\test_dir");
2383+
test_dir_abs_size += strlen("\\test_dir");
23842384
test_dir = test_dir_abs_buf;
23852385
#else
23862386
uv_cwd(test_dir_abs_buf, &test_dir_abs_size);
@@ -2435,8 +2435,8 @@ int test_symlink_dir_impl(int type) {
24352435
r = uv_fs_realpath(NULL, &req, "test_dir_symlink", NULL);
24362436
ASSERT_OK(r);
24372437
#ifdef _WIN32
2438-
ASSERT_EQ(strlen(req.ptr), test_dir_abs_size - 5);
2439-
ASSERT_OK(_strnicmp(req.ptr, test_dir + 4, test_dir_abs_size - 5));
2438+
ASSERT_EQ(strlen(req.ptr), test_dir_abs_size - 4);
2439+
ASSERT_OK(_strnicmp(req.ptr, test_dir + 4, test_dir_abs_size - 4));
24402440
#else
24412441
ASSERT_OK(strcmp(req.ptr, test_dir_abs_buf));
24422442
#endif

0 commit comments

Comments
 (0)