diff options
| author | Antony Dovgal <tony2001@php.net> | 2006-05-16 13:05:02 +0000 |
|---|---|---|
| committer | Antony Dovgal <tony2001@php.net> | 2006-05-16 13:05:02 +0000 |
| commit | 3a830a30f4eacd837fe543e7279382ebee4ed99b (patch) | |
| tree | 67ef77ba2961c8262bf1bc42ae3a02c3959dae99 /main/streams/plain_wrapper.c | |
| parent | 26a67b8925d991136a28dab1292e5983b8642b15 (diff) | |
| download | php-git-3a830a30f4eacd837fe543e7279382ebee4ed99b.tar.gz | |
fix #37395 (recursive mkdir() fails to create nonexistent directories in root dir)
Diffstat (limited to 'main/streams/plain_wrapper.c')
| -rw-r--r-- | main/streams/plain_wrapper.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index ac5ad825db..2180318fcf 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -1100,7 +1100,7 @@ static int php_plain_files_mkdir(php_stream_wrapper *wrapper, char *dir, int mod } else { /* find a top level directory we need to create */ - while ( (p = strrchr(buf + offset, DEFAULT_SLASH)) || (p = strrchr(buf, DEFAULT_SLASH)) ) { + while ( (p = strrchr(buf + offset, DEFAULT_SLASH)) || ( offset !=1 && (p = strrchr(buf, DEFAULT_SLASH))) ) { *p = '\0'; if (VCWD_STAT(buf, &sb) == 0) { *p = DEFAULT_SLASH; |
