com php-src: Merge branch 'PHP-7.2': win32/ioutil.c

From: Date: Wed, 11 Jul 2018 11:16:04 +0000
Subject: com php-src: Merge branch 'PHP-7.2': win32/ioutil.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-102521@lists.php.net to get a copy of this message
Commit: 871d0aa5cd01aba5f31f28b641e2b013ac46ec58 Author: Anatol Belski <ab@php.net> Wed, 11 Jul 2018 13:16:04 +0200 Parents: 14db98825af38c53a6df276574489b3b08a48558 cc266045a5cc32d839f9fbf0677d85beeef1bb06 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=871d0aa5cd01aba5f31f28b641e2b013ac46ec58 Log: Merge branch 'PHP-7.2' * PHP-7.2: Fix condition Changed paths: MM win32/ioutil.c Diff: diff --cc win32/ioutil.c index 9e54e96,9a13c1c..2ff62e3 --- a/win32/ioutil.c +++ b/win32/ioutil.c @@@ -283,20 -285,33 +283,20 @@@ PW32IO int php_win32_ioutil_close(int f return result; }/*}}}*/ -#if 0 PW32IO int php_win32_ioutil_mkdir_w(const wchar_t *path, mode_t mode) {/*{{{*/ - int ret = 0; - DWORD err = 0; + size_t path_len; + const wchar_t *my_path; - PHP_WIN32_IOUTIL_CHECK_PATH_W(path, -1, 0) - - /* TODO extend with mode usage */ - if (!CreateDirectoryW(path, NULL)) { - err = GetLastError(); - ret = -1; - SET_ERRNO_FROM_WIN32_CODE(err); + if (!path) { + SET_ERRNO_FROM_WIN32_CODE(ERROR_INVALID_PARAMETER); + return -1; } - return ret; -}/*}}}*/ -#endif - -PW32IO int php_win32_ioutil_mkdir(const char *path, mode_t mode) -{/*{{{*/ - size_t pathw_len = 0; - wchar_t *pathw = php_win32_ioutil_conv_any_to_w(path, 0, &pathw_len); - int ret = 0; - DWORD err = 0; + PHP_WIN32_IOUTIL_CHECK_PATH_W(path, -1, 0) - if (pathw_len < _MAX_PATH && pathw_len >= _MAX_PATH - 12) { + path_len = wcslen(path); - if (path_len < _MAX_PATH && path_len > _MAX_PATH - 12) { ++ if (path_len < _MAX_PATH && path_len >= _MAX_PATH - 12) { /* Special case here. From the doc: "When using an API to create a directory, the specified path cannot be

« previous php.cvs (#102521) next »