From 598d02197263b999a02467dbdd42e6a081b108a8 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 5 Sep 2007 02:58:01 +0000 Subject: [PATCH] * Fixed bug in the code normalizing entry paths, causing e.g. broken symlinks to be not openable. * When _kern_open() created a new file, invalid stat data were accessed. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22176 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/build/libroot/fs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/build/libroot/fs.cpp b/src/build/libroot/fs.cpp index 5e649791a0..7622785034 100644 --- a/src/build/libroot/fs.cpp +++ b/src/build/libroot/fs.cpp @@ -159,7 +159,7 @@ normalize_entry_path(const char *path, string &normalizedPath) } // catch special case: no leaf, or leaf is a directory - if (!leafName || strcmp(leafName, ".") == 0 || strcmp(leafName, "..")) + if (!leafName || strcmp(leafName, ".") == 0 || strcmp(leafName, "..") == 0) return normalize_dir_path(path, normalizedPath); // normalize the dir path @@ -514,7 +514,7 @@ open_file(const char *path, int openMode, int perms) } // cache path, if this is a directory - if (S_ISDIR(st.st_mode)) + if (exists && S_ISDIR(st.st_mode)) add_dir_path(path, NodeRef(st)); return add_descriptor(descriptor);