aboutsummaryrefslogtreecommitdiff
path: root/posix/glob.c
diff options
context:
space:
mode:
Diffstat (limited to 'posix/glob.c')
-rw-r--r--posix/glob.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/posix/glob.c b/posix/glob.c
index 6ae09ef480..d6a1a4a2d1 100644
--- a/posix/glob.c
+++ b/posix/glob.c
@@ -455,7 +455,8 @@ glob (pattern, flags, errfunc, pglob)
}
}
else if (filename == pattern
- || (filename == pattern + 1 && pattern[0] == '\\'))
+ || (filename == pattern + 1 && pattern[0] == '\\'
+ && (flags & GLOB_NOESCAPE) == 0))
{
/* "/pattern" or "\\/pattern". */
dirname = "/";