summaryrefslogtreecommitdiffstats
path: root/src/printf.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-07-13 15:22:42 -0400
committerTavian Barnes <tavianator@tavianator.com>2023-07-13 16:02:56 -0400
commitc5a2bfd924445dfccd943ea34374a5d1266f5cb9 (patch)
tree107939d8c2b35a799a23ae6806f62c98ad6efcc9 /src/printf.c
parentb577bedfd37d93cb802c36beb93cf6581af51930 (diff)
downloadbfs-c5a2bfd924445dfccd943ea34374a5d1266f5cb9.tar.xz
color: TTY-escape filenames
Diffstat (limited to 'src/printf.c')
-rw-r--r--src/printf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/printf.c b/src/printf.c
index 6520d2d..f0910fa 100644
--- a/src/printf.c
+++ b/src/printf.c
@@ -298,7 +298,7 @@ static int bfs_printf_h(CFILE *cfile, const struct bfs_printf *directive, const
int ret;
if (should_color(cfile, directive)) {
- ret = cfprintf(cfile, "${di}%s${rs}", buf);
+ ret = cfprintf(cfile, "${di}%pQ${rs}", buf);
} else {
ret = dyn_fprintf(cfile->file, directive, buf);
}
@@ -313,7 +313,7 @@ static int bfs_printf_H(CFILE *cfile, const struct bfs_printf *directive, const
if (ftwbuf->depth == 0) {
return cfprintf(cfile, "%pP", ftwbuf);
} else {
- return cfprintf(cfile, "${di}%s${rs}", ftwbuf->root);
+ return cfprintf(cfile, "${di}%pQ${rs}", ftwbuf->root);
}
} else {
return dyn_fprintf(cfile->file, directive, ftwbuf->root);