From 2a5ffc60c339ccc108a2feedd522d871da4d094b Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 8 Jun 2023 13:29:45 -0400 Subject: eval: Print non-path -ls text in the "normal" color, like ls -l --- src/eval.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/eval.c') 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; } -- cgit v1.2.3