summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-05-11 01:53:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-05-11 01:53:48 +0000
commit65ea437148169673823a09d4bf66d97a1187d8dd (patch)
tree480600fa06cf7fa18d210db866ebd829ea77427a /dir.c
parent8473a8293457ab60679bee0aaa44fc4fae945224 (diff)
* dir.c (glob_helper): remove escaping backslashes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/dir.c b/dir.c
index 8ade547..3df0c0c 100644
--- a/dir.c
+++ b/dir.c
@@ -637,7 +637,6 @@ static void
remove_backslashes(p)
char *p;
{
-#if defined DOSISH
char *pend = p + strlen(p);
char *t = p;
@@ -648,7 +647,6 @@ remove_backslashes(p)
*t++ = *p++;
}
*t = '\0';
-#endif
}
#ifndef S_ISDIR
@@ -668,7 +666,11 @@ glob_helper(path, sub, flags, func, arg)
p = sub ? sub : path;
if (!has_magic(p, 0, flags)) {
+#if defined DOSISH
remove_backslashes(path);
+#else
+ if (!(flags & FNM_NOESCAPE)) remove_backslashes(p);
+#endif
if (stat(path, &st) == 0) {
(*func)(path, arg);
}