From: Anatol Belski Date: Fri, 13 Jan 2017 15:54:10 +0000 (+0100) Subject: Merge branch 'PHP-7.0' into PHP-7.1 X-Git-Tag: php-7.1.2RC1~78 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a7b20894e5aa0b0b1a310508b5fb708541657786;p=php Merge branch 'PHP-7.0' into PHP-7.1 * PHP-7.0: ensure the end path wouldn't contain double slashes --- a7b20894e5aa0b0b1a310508b5fb708541657786 diff --cc ext/opcache/shared_alloc_win32.c index 7532fe1688,d05f01cd2b..0cf65cf90a --- a/ext/opcache/shared_alloc_win32.c +++ b/ext/opcache/shared_alloc_win32.c @@@ -93,19 -88,17 +93,22 @@@ static char *create_name_with_username( static char *get_mmap_base_file(void) { static char windir[MAXPATHLEN+UNLEN + 3 + sizeof("\\\\@") + 1 + 32]; - char uname[UNLEN + 1]; - DWORD unsize = UNLEN; + char *uname; int l; + uname = php_win32_get_username(); + if (!uname) { + return NULL; + } 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)); + + free(uname); + return windir; }