From 8e993b427ccc5e410ab95f9d1079965862b14969 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 13 Jan 2017 16:50:05 +0100 Subject: [PATCH] ensure the end path wouldn't contain double slashes --- ext/opcache/shared_alloc_win32.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/opcache/shared_alloc_win32.c b/ext/opcache/shared_alloc_win32.c index 17af776f600..d05f01cd2b2 100644 --- a/ext/opcache/shared_alloc_win32.c +++ b/ext/opcache/shared_alloc_win32.c @@ -95,6 +95,9 @@ static char *get_mmap_base_file(void) GetTempPath(MAXPATHLEN, windir); GetUserName(uname, &unsize); l = strlen(windir); + if ('\\' == windir[l-1]) { + l--; + } snprintf(windir + l, sizeof(windir) - l - 1, "\\%s@%s@%.32s", ACCEL_FILEMAP_BASE, uname, ZCG(system_id)); return windir; }