summaryrefslogtreecommitdiffstats
path: root/drivers/unix
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-09-12 10:28:44 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-09-12 10:28:44 +0200
commitcc5211214432515bf36af8b01e5eaaea242022a2 (patch)
tree1588e2925d36a3fa118b5b3915f8ab21b04e0386 /drivers/unix
parent6b9f4418bb3802992fbf41e52c032d07e02974b4 (diff)
parentda4f5fb953dfeac78093235b0d0828ca944aa0a4 (diff)
downloadredot-engine-cc5211214432515bf36af8b01e5eaaea242022a2.tar.gz
Merge pull request #96643 from bruvzg/fs_links
[FileSystem Dock] Add symlink indicator and tooltip.
Diffstat (limited to 'drivers/unix')
-rw-r--r--drivers/unix/dir_access_unix.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp
index 489181a025..e4bad88083 100644
--- a/drivers/unix/dir_access_unix.cpp
+++ b/drivers/unix/dir_access_unix.cpp
@@ -419,6 +419,9 @@ Error DirAccessUnix::remove(String p_path) {
}
p_path = fix_path(p_path);
+ if (p_path.ends_with("/")) {
+ p_path = p_path.left(-1);
+ }
struct stat flags = {};
if ((stat(p_path.utf8().get_data(), &flags) != 0)) {
@@ -438,6 +441,9 @@ bool DirAccessUnix::is_link(String p_file) {
}
p_file = fix_path(p_file);
+ if (p_file.ends_with("/")) {
+ p_file = p_file.left(-1);
+ }
struct stat flags = {};
if ((lstat(p_file.utf8().get_data(), &flags) != 0)) {
@@ -453,6 +459,9 @@ String DirAccessUnix::read_link(String p_file) {
}
p_file = fix_path(p_file);
+ if (p_file.ends_with("/")) {
+ p_file = p_file.left(-1);
+ }
char buf[256];
memset(buf, 0, 256);