From 37daffaccbe4e2f02682e4a3e6e598574a845675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Fri, 12 Dec 2014 10:01:19 +0100 Subject: [PATCH] test: fix cwd_and_chdir test on Unix There is no need to check for a trailing slash, uv_cwd ensures it. PR-URL: https://github.com/libuv/libuv/pull/63 Reviewed-By: Bert Belder Reviewed-By: Ben Noordhuis --- test/test-cwd-and-chdir.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/test/test-cwd-and-chdir.c b/test/test-cwd-and-chdir.c index 08ca1ed7..1e95043c 100644 --- a/test/test-cwd-and-chdir.c +++ b/test/test-cwd-and-chdir.c @@ -31,28 +31,12 @@ TEST_IMPL(cwd_and_chdir) { char buffer_new[PATHMAX]; size_t size1; size_t size2; - char* last_slash; int err; size1 = sizeof buffer_orig; err = uv_cwd(buffer_orig, &size1); ASSERT(err == 0); - /* Remove trailing slash unless at a root directory. */ -#ifdef _WIN32 - last_slash = strrchr(buffer_orig, '\\'); - ASSERT(last_slash); - if (last_slash > buffer_orig && *(last_slash - 1) != ':') { - *last_slash = '\0'; - } -#else /* Unix */ - last_slash = strrchr(buffer_orig, '/'); - ASSERT(last_slash); - if (last_slash != buffer_orig) { - *last_slash = '\0'; - } -#endif - err = uv_chdir(buffer_orig); ASSERT(err == 0);