You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-libs/ding-libs/files/0001-path_utils_ut-allow-si...

37 lines
1.2 KiB

From 4236e323e8ab4f13770e1ac9e94666b304b693fb Mon Sep 17 00:00:00 2001
From: Henrik Riomar <henrik.riomar@gmail.com>
Date: Tue, 24 Jul 2018 21:59:36 +0000
Subject: [PATCH 1/2] path_utils_ut: allow single / as well
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap03.html#tag_03_266
Multiple successive slashes are considered to be the same as one slash.
When running the tests on a musl libc system
get_dirname(p, PATH_MAX, "//foo//")
actually results in a / and not //
Reviewed-by: Michal Židek <mzidek@redhat.com>
---
path_utils/path_utils_ut.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/path_utils/path_utils_ut.c b/path_utils/path_utils_ut.c
index 27c99b6..061abfb 100644
--- a/path_utils/path_utils_ut.c
+++ b/path_utils/path_utils_ut.c
@@ -62,7 +62,7 @@ START_TEST(test_dirname)
fail_unless_str_equal(p, "//foo");
fail_unless(get_dirname(p, PATH_MAX, "//foo//") == SUCCESS);
- fail_unless_str_equal(p, "//");
+ fail_unless(!strcmp(p, "/") || !strcmp(p, "//"));
fail_unless(get_dirname(p, PATH_MAX, "foo//bar") == SUCCESS);
fail_unless_str_equal(p, "foo");
--
2.21.0