summaryrefslogtreecommitdiff
path: root/src/du.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-09-16 08:08:32 +0000
committerJim Meyering <jim@meyering.net>2005-09-16 08:08:32 +0000
commitd5eda08be3fa603b34c09277d989b58d31653a8d (patch)
treec904735851e1cd63c5567c5909e438c00106349c /src/du.c
parent4fdd25e01277153a0eedbdd4fd510c7c8bd850e5 (diff)
downloadcoreutils-d5eda08be3fa603b34c09277d989b58d31653a8d.tar.xz
Include fprintftime.h.
Don't include strftime.h or xanstrftime.h -- no longer needed. (show_date): Use new fprintftime function rather than xanstrftime. Correct comment: this function no longer handles a NULL format string.
Diffstat (limited to 'src/du.c')
-rw-r--r--src/du.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/du.c b/src/du.c
index 84c9b4aad..7af3dc167 100644
--- a/src/du.c
+++ b/src/du.c
@@ -34,6 +34,7 @@
#include "dirname.h" /* for strip_trailing_slashes */
#include "error.h"
#include "exclude.h"
+#include "fprintftime.h"
#include "hash.h"
#include "human.h"
#include "inttostr.h"
@@ -42,8 +43,6 @@
#include "readtokens0.h"
#include "same.h"
#include "stat-time.h"
-#include "strftime.h"
-#include "xanstrftime.h"
#include "xfts.h"
#include "xstrtol.h"
@@ -402,13 +401,11 @@ hash_init (void)
/* FIXME: this code is nearly identical to code in date.c */
/* Display the date and time in WHEN according to the format specified
- in TIME_FORMAT. If TIME_FORMAT is NULL, use the standard output format.
- Return zero if successful. */
+ in FORMAT. */
static void
show_date (const char *format, struct timespec when)
{
- char *out;
struct tm *tm = localtime (&when.tv_sec);
if (! tm)
{
@@ -421,9 +418,7 @@ show_date (const char *format, struct timespec when)
return;
}
- out = xanstrftime (format, tm, 0, when.tv_nsec);
- fputs (out, stdout);
- free (out);
+ fprintftime (stdout, format, tm, 0, when.tv_nsec);
}
/* Print N_BYTES. Convert it to a readable value before printing. */