]> granicus.if.org Git - php/commitdiff
chdir returns -1 on error, so should V_CHDIR
authorStanislav Malyshev <stas@php.net>
Sun, 4 Jun 2000 07:59:32 +0000 (07:59 +0000)
committerStanislav Malyshev <stas@php.net>
Sun, 4 Jun 2000 07:59:32 +0000 (07:59 +0000)
main/php_virtual_cwd.c

index c42f018c3e3393ed952205c1a0311b742eb005f9..412929db1516956ec10e6d50954889dbb10f10fc 100644 (file)
@@ -245,7 +245,7 @@ CWD_API char *virtual_getcwd(char *buf, size_t size)
        return buf;
 }
 
-
+/* Resolve path relatively to state and put the real path into state */
 /* returns 0 for ok, 1 for error */
 CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path)
 {
@@ -350,7 +350,7 @@ CWD_API int virtual_chdir(char *path)
 {
        CWDLS_FETCH();
 
-       return virtual_file_ex(&CWDG(cwd), path, php_is_dir_ok);
+       return virtual_file_ex(&CWDG(cwd), path, php_is_dir_ok)?-1:0;
 }
 
 CWD_API int virtual_chdir_file(char *path)