summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2004-06-07 18:30:16 +0000
committerIlia Alshanetsky <iliaa@php.net>2004-06-07 18:30:16 +0000
commitceb70dbc681df1f5bde7cdc296176fd5734b8312 (patch)
treea360ddbda0cf65e42ef1428459f0d228293232aa
parentf05924db37a070184c991404d621102ade8df726 (diff)
downloadphp-git-ceb70dbc681df1f5bde7cdc296176fd5734b8312.tar.gz
Fixed bug #28668 (glob() does not work with relative paths on Windows).
-rw-r--r--ext/standard/dir.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index 9a3c1c87be..9642c93781 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -380,13 +380,12 @@ PHP_FUNCTION(glob)
cwd[0] = '\0';
}
#ifdef PHP_WIN32
- if (!IS_SLASH(cwd[0])) {
+ if (IS_SLASH(*pattern)) {
cwd[2] = '\0';
- cwd_skip = 3;
}
-#else
- cwd_skip = strlen(cwd)+1;
#endif
+ cwd_skip = strlen(cwd)+1;
+
snprintf(work_pattern, MAXPATHLEN, "%s%c%s", cwd, DEFAULT_SLASH, pattern);
pattern = work_pattern;
}