aboutsummaryrefslogtreecommitdiffstats
path: root/main/musl/0042-fix-glob-failure-to-match-plain-to-root-directory.patch
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2017-06-21 11:29:38 +0300
committerTimo Teräs <timo.teras@iki.fi>2017-06-21 11:29:38 +0300
commitd985d2b50a41eb5f9ba682f4afe72ac2c59b53e8 (patch)
tree767a67cd54db1beb8549106f1b729699411df431 /main/musl/0042-fix-glob-failure-to-match-plain-to-root-directory.patch
parent6b899d49bd1d15c8390bd53e710da0b26a36218e (diff)
downloadaports-d985d2b50a41eb5f9ba682f4afe72ac2c59b53e8.tar.bz2
aports-d985d2b50a41eb5f9ba682f4afe72ac2c59b53e8.tar.xz
main/musl: cherry-pick upstream fixes
Diffstat (limited to 'main/musl/0042-fix-glob-failure-to-match-plain-to-root-directory.patch')
-rw-r--r--main/musl/0042-fix-glob-failure-to-match-plain-to-root-directory.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/main/musl/0042-fix-glob-failure-to-match-plain-to-root-directory.patch b/main/musl/0042-fix-glob-failure-to-match-plain-to-root-directory.patch
new file mode 100644
index 0000000000..cc9166248e
--- /dev/null
+++ b/main/musl/0042-fix-glob-failure-to-match-plain-to-root-directory.patch
@@ -0,0 +1,30 @@
+From 84eff797e3e38210cc311b000b1586b948b4fc35 Mon Sep 17 00:00:00 2001
+From: Rich Felker <dalias@aerifal.cx>
+Date: Thu, 8 Jun 2017 19:50:23 -0400
+Subject: [PATCH] fix glob failure to match plain "/" to root directory
+
+the check to prevent matching empty string wrongly blocked matching
+of "/" due to checking emptiness after stripping leading slashes
+rather than checking the full original argument string.
+
+simplified from patch by Julien Ramseier.
+---
+ src/regex/glob.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/regex/glob.c b/src/regex/glob.c
+index 5b6ff124..2d4d562e 100644
+--- a/src/regex/glob.c
++++ b/src/regex/glob.c
+@@ -179,7 +179,7 @@ int glob(const char *restrict pat, int flags, int (*errfunc)(const char *path, i
+
+ if (strnlen(p, PATH_MAX+1) > PATH_MAX) return GLOB_NOSPACE;
+
+- if (*p) error = match_in_dir(d, p, flags, errfunc, &tail);
++ if (*pat) error = match_in_dir(d, p, flags, errfunc, &tail);
+ if (error == GLOB_NOSPACE) {
+ freelist(&head);
+ return error;
+--
+2.13.0
+