summaryrefslogtreecommitdiffstats
path: root/printf.c
diff options
context:
space:
mode:
Diffstat (limited to 'printf.c')
-rw-r--r--printf.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/printf.c b/printf.c
index 27d9521..86804b8 100644
--- a/printf.c
+++ b/printf.c
@@ -81,6 +81,7 @@ static int bfs_printf_flush(FILE *file, const struct bfs_printf_directive *direc
*/
static const struct timespec *get_time_field(const struct bfs_stat *statbuf, enum bfs_stat_field stat_field) {
if (!(statbuf->mask & stat_field)) {
+ errno = ENOTSUP;
return NULL;
}
@@ -700,6 +701,11 @@ struct bfs_printf *parse_bfs_printf(const char *format, struct cmdline *cmdline)
directive->fn = bfs_printf_U;
command->needs_stat = true;
break;
+ case 'w':
+ directive->fn = bfs_printf_ctime;
+ directive->stat_field = BFS_STAT_BTIME;
+ command->needs_stat = true;
+ break;
case 'y':
directive->fn = bfs_printf_y;
break;
@@ -716,6 +722,9 @@ struct bfs_printf *parse_bfs_printf(const char *format, struct cmdline *cmdline)
case 'T':
directive->stat_field = BFS_STAT_MTIME;
goto directive_strftime;
+ case 'W':
+ directive->stat_field = BFS_STAT_BTIME;
+ goto directive_strftime;
directive_strftime:
directive->fn = bfs_printf_strftime;