diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2023-06-08 13:29:45 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-06-08 13:29:45 -0400 |
commit | 2a5ffc60c339ccc108a2feedd522d871da4d094b (patch) | |
tree | 145b11fbf699dd68f14d6b18451404b6ae891a38 /src/eval.c | |
parent | 1d1443193878ae72e54560bb21de79668cd954b9 (diff) | |
download | bfs-2a5ffc60c339ccc108a2feedd522d871da4d094b.tar.xz |
eval: Print non-path -ls text in the "normal" color, like ls -l
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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; } |