]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.2'
authorAnatol Belski <ab@php.net>
Wed, 11 Jul 2018 11:16:04 +0000 (13:16 +0200)
committerAnatol Belski <ab@php.net>
Wed, 11 Jul 2018 11:16:04 +0000 (13:16 +0200)
* PHP-7.2:
  Fix condition

1  2 
win32/ioutil.c

diff --cc win32/ioutil.c
index 9e54e963424b982353bba5dfe4d37389de7caad6,9a13c1cd6e2387fc3b6a0ccd65a4df899e7c2e72..2ff62e3b6ce9b3ea243355fe76e17fc533e1960d
@@@ -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