From e2d3206e783efc071df9f74c1fae17aa5c77974d Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Tue, 16 May 2006 13:05:23 +0000 Subject: [PATCH] MFB: fix #37395 (recursive mkdir() fails to create nonexistent directories in root dir) --- main/streams/plain_wrapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index adfb9b4bf1..710bb863de 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -1081,7 +1081,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; -- 2.50.1