From: Eric Lammerts Date: Sat, 30 Oct 2010 00:48:20 +0000 (+0200) Subject: stat: fix mtime/ctime/atime X-Git-Tag: 1_18_0~36 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=66be9197a5111d0293732f4823d1711ccab51675;p=oweals%2Fbusybox.git stat: fix mtime/ctime/atime If you set CONFIG_FEATURE_STAT_FORMAT=n, two of the three printed times are wrong, because a global buffer is reused. Fix below. Signed-off-by: Eric Lammerts Signed-off-by: Denys Vlasenko --- diff --git a/coreutils/stat.c b/coreutils/stat.c index b4e6f10fd..7351f5956 100644 --- a/coreutils/stat.c +++ b/coreutils/stat.c @@ -630,10 +630,9 @@ static bool do_stat(const char *filename, const char *format) # if ENABLE_SELINUX printf(" S_Context: %lc\n", *scontext); # endif - printf("Access: %s\n" "Modify: %s\n" "Change: %s\n", - human_time(statbuf.st_atime), - human_time(statbuf.st_mtime), - human_time(statbuf.st_ctime)); + printf("Access: %s\n", human_time(statbuf.st_atime)); + printf("Modify: %s\n", human_time(statbuf.st_mtime)); + printf("Change: %s\n", human_time(statbuf.st_ctime)); } #endif /* FEATURE_STAT_FORMAT */ return 1;