mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Fix failing New-Item tests
PowerShell expects the behavior of NativeItemExists to not follow symbolic links.
This commit is contained in:
1 parent
35e24ce6d4
commit
74c3262f03
1 file changed
+3
-1
@@ -7,6 +7,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <pwd.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include "isfile.h"
|
||||
|
||||
@@ -36,5 +37,6 @@ bool IsFile(const char* path)
|
||||
return false;
|
||||
}
|
||||
|
||||
return access(path, F_OK) != -1;
|
||||
// Resolve relative paths to cwd of process, and do not follow symlinks
|
||||
return faccessat(AT_FDCWD, path, F_OK, AT_SYMLINK_NOFOLLOW) != -1;
|
||||
}
|
||||
Reference in new issue
Block a user