summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-06-08 13:29:45 -0400
committerTavian Barnes <tavianator@tavianator.com>2023-06-08 13:29:45 -0400
commit2a5ffc60c339ccc108a2feedd522d871da4d094b (patch)
tree145b11fbf699dd68f14d6b18451404b6ae891a38 /src
parent1d1443193878ae72e54560bb21de79668cd954b9 (diff)
downloadbfs-2a5ffc60c339ccc108a2feedd522d871da4d094b.tar.xz
eval: Print non-path -ls text in the "normal" color, like ls -l
Diffstat (limited to 'src')
-rw-r--r--src/eval.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c
index 342debd..7015f6c 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -642,6 +642,11 @@ bool eval_fls(const struct bfs_expr *expr, struct bfs_eval *state) {
goto done;
}
+ // ls -l prints non-path text in the "normal" color, so do the same
+ if (cfprintf(cfile, "${no}") < 0) {
+ goto error;
+ }
+
uintmax_t ino = statbuf->ino;
uintmax_t block_size = ctx->posixly_correct ? 512 : 1024;
uintmax_t blocks = ((uintmax_t)statbuf->blocks*BFS_STAT_BLKSIZE + block_size - 1)/block_size;
@@ -709,7 +714,7 @@ bool eval_fls(const struct bfs_expr *expr, struct bfs_eval *state) {
errno = EOVERFLOW;
goto error;
}
- if (fprintf(file, " %s", time_str) < 0) {
+ if (cfprintf(cfile, " %s${rs}", time_str) < 0) {
goto error;
}