]> granicus.if.org Git - php/commitdiff
Fix Andi's GetLongPathName code so that virtual_file_ex doesn't
authorWez Furlong <wez@php.net>
Thu, 4 Dec 2003 17:02:09 +0000 (17:02 +0000)
committerWez Furlong <wez@php.net>
Thu, 4 Dec 2003 17:02:09 +0000 (17:02 +0000)
fail if the file does not exist.

TSRM/tsrm_virtual_cwd.c

index 0d9fb7197c9ca17761d988100d2b06aa31b815c0..cc4ba889d924742436218988fc0ba9638b652601 100644 (file)
@@ -347,12 +347,15 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
                        return 1;
                }
                
-               if (GetLongPathName(path, new_path, new_path_length) == 0) {
+               if (GetLongPathName(path, new_path, new_path_length) != 0) {
+                       path = new_path;
+                       path_length = new_path_length;
+               } else {
                        free(new_path);
-                       return 1;
+                       if (GetLastError() != ERROR_FILE_NOT_FOUND) {
+                               return 1;
+                       }
                }
-               path = new_path;
-               path_length = new_path_length;
        }
 #endif
        free_path = path_copy = tsrm_strndup(path, path_length);