]> granicus.if.org Git - php/commitdiff
MFH:fix mkdir() function properly (patch by nlopess)
authorfoobar <sniper@php.net>
Fri, 23 Dec 2005 18:57:39 +0000 (18:57 +0000)
committerfoobar <sniper@php.net>
Fri, 23 Dec 2005 18:57:39 +0000 (18:57 +0000)
TSRM/tsrm_virtual_cwd.c

index 8955bd823429e2d7158034ffd29b4112fb0ea87a..de126e6c7a3180f4c5efd9d805b68ec6b9838084 100644 (file)
@@ -480,9 +480,9 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
        {
                int new_path_length;
   
-               new_path_length = GetLongPathName(path, NULL, 0) + 1;
+               new_path_length = GetLongPathName(path, NULL, 0);
                if (new_path_length == 0) {
-                       return 1;
+                       goto php_failed_getlongpath;
                }
 
                /* GetLongPathName already counts the \0 */
@@ -496,6 +496,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
                        path_length = new_path_length;
                } else {
                        free(new_path);
+php_failed_getlongpath:
                        new_path = NULL;
                }
        }