summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2004-05-09 19:01:13 +0000
committerIlia Alshanetsky <iliaa@php.net>2004-05-09 19:01:13 +0000
commit468e834ef1366ce51ff002bc84fe2e976073b082 (patch)
treec4c6ab68e8af353ced1a0120d68bc0bd7a93de92
parenta4c3c3cd47b7cc4be531572f814ea589ad58c77c (diff)
downloadphp-git-468e834ef1366ce51ff002bc84fe2e976073b082.tar.gz
Fixed bug #28289 (incorrect resolving of relative paths by glob() in
windows).
-rw-r--r--ext/standard/dir.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index 0d9bdfb90b..4609d15d67 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -379,11 +379,13 @@ PHP_FUNCTION(glob)
if (!result) {
cwd[0] = '\0';
}
- cwd_skip = strlen(cwd)+1;
#ifdef PHP_WIN32
- if (IS_SLASH(cwd[0]) && !IS_UNC_PATH(pattern, pattern_len)) {
+ if (!IS_SLASH(cwd[0])) {
cwd[2] = '\0';
+ cwd_skip = 3;
}
+#else
+ cwd_skip = strlen(cwd)+1;
#endif
snprintf(work_pattern, MAXPATHLEN, "%s%c%s", cwd, DEFAULT_SLASH, pattern);
pattern = work_pattern;