summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2017-03-16 23:30:21 -0400
committerTavian Barnes <tavianator@tavianator.com>2017-03-16 23:30:21 -0400
commit4da8ba603b588bef38f772c18d883fbf5ddc9e65 (patch)
tree583b6182ebc22baf1c1ce39a4686da0375ff0f04 /eval.c
parentc85f569daf3e0e99c9e8941d0234711afdb58cd7 (diff)
downloadbfs-4da8ba603b588bef38f772c18d883fbf5ddc9e65.tar.xz
Color link targets for -ls
Fixes #18.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/eval.c b/eval.c
index 1a8bc02..ded73cb 100644
--- a/eval.c
+++ b/eval.c
@@ -760,13 +760,7 @@ bool eval_fls(const struct expr *expr, struct eval_state *state) {
}
if (ftwbuf->typeflag == BFTW_LNK) {
- char *target = xreadlinkat(ftwbuf->at_fd, ftwbuf->at_path, statbuf->st_size);
- if (!target) {
- goto error;
- }
- int ret = fprintf(file, " -> %s", target);
- free(target);
- if (ret < 0) {
+ if (cfprintf(cfile, " -> %L", ftwbuf) < 0) {
goto error;
}
}