diff options
Diffstat (limited to 'dev-libs/ding-libs/files/0001-path_utils_ut-allow-single-as-well.patch')
-rw-r--r-- | dev-libs/ding-libs/files/0001-path_utils_ut-allow-single-as-well.patch | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/dev-libs/ding-libs/files/0001-path_utils_ut-allow-single-as-well.patch b/dev-libs/ding-libs/files/0001-path_utils_ut-allow-single-as-well.patch new file mode 100644 index 000000000000..a9ca8e9edc2b --- /dev/null +++ b/dev-libs/ding-libs/files/0001-path_utils_ut-allow-single-as-well.patch @@ -0,0 +1,36 @@ +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 + |