com php-src: Merge branch 'PHP-7.0' into PHP-7.1: ext/opcache/s hared_alloc_win32.c

From: Date: Fri, 13 Jan 2017 15:54:10 +0000
Subject: com php-src: Merge branch 'PHP-7.0' into PHP-7.1: ext/opcache/s hared_alloc_win32.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-96718@lists.php.net to get a copy of this message
Commit: a7b20894e5aa0b0b1a310508b5fb708541657786 Author: Anatol Belski <ab@php.net> Fri, 13 Jan 2017 16:54:10 +0100 Parents: 2ae5f2d1a5a208cc748b509cf71fdceb0989520a 8e993b427ccc5e410ab95f9d1079965862b14969 Branches: PHP-7.1 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a7b20894e5aa0b0b1a310508b5fb708541657786 Log: Merge branch 'PHP-7.0' into PHP-7.1 * PHP-7.0: ensure the end path wouldn't contain double slashes Changed paths: MM ext/opcache/shared_alloc_win32.c Diff: diff --cc ext/opcache/shared_alloc_win32.c index 7532fe1,d05f01c..0cf65cf --- 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; }

« previous php.cvs (#96718) next »