summaryrefslogtreecommitdiffstats
path: root/sysif.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-07-20 07:18:08 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-07-20 07:18:08 -0700
commit9c2fcf3aeae6cd112a1e5b5e8374a03cf5217c9b (patch)
treeccadbcbe54c724271f5dd61c58983d5fe9b08f5d /sysif.c
parentd9afdbb32c0dd0b693e01b4204176d333805571b (diff)
downloadtxr-9c2fcf3aeae6cd112a1e5b5e8374a03cf5217c9b.tar.gz
txr-9c2fcf3aeae6cd112a1e5b5e8374a03cf5217c9b.tar.bz2
txr-9c2fcf3aeae6cd112a1e5b5e8374a03cf5217c9b.zip
distat: bugfix: use lstat.
* sysif.c (dirstat): Call lstat_wrap, rather than stat_wrap. This function must report about the directory entry itself, not about what that entry points to if it happens to be a symlink. The d-type member of the dirent structure representing a symlink must be set to dt-lnk. * txr.1: Updated.
Diffstat (limited to 'sysif.c')
-rw-r--r--sysif.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysif.c b/sysif.c
index 019b66a4..5830ffc0 100644
--- a/sysif.c
+++ b/sysif.c
@@ -2327,7 +2327,7 @@ static val dirstat(val dirent, val dir_path, val stat_opt)
val self = lit("dirstat");
val name = slot(dirent, name_s);
val path = if3(null_or_missing_p(dir_path), name, path_cat(dir_path, name));
- val stat = stat_wrap(path, stat_opt);
+ val stat = lstat_wrap(path, stat_opt);
val mode = slot(stat, mode_s);
if (mode) {