summaryrefslogtreecommitdiff
path: root/src/ls.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-06-27 10:54:23 +0200
committerJim Meyering <meyering@redhat.com>2008-06-27 10:54:23 +0200
commita67685628504d92b80eabe7cdc02c500f12b4873 (patch)
tree55f09b93cd3d7454edf9b235815f0922c10a4d59 /src/ls.c
parente2dbcee444e90e4289bd4bdc36783a5ef00af396 (diff)
downloadcoreutils-a67685628504d92b80eabe7cdc02c500f12b4873.tar.xz
factor out time_t-to-string conversion idiom
* src/system.h: Include "inttostr.h". (timetostr): New function, factored out of... * src/date.c (show_date): Use timetostr. * src/du.c (show_date): Likewise. * src/ls.c (print_long_format): Likewise. * src/pinky.c (time_string): Likewise. * src/stat.c (human_time): Likewise. * src/*.c: Don't include inttostr.h, since system.h does. * src/c99-to-c89.diff: Adjust offsets.
Diffstat (limited to 'src/ls.c')
-rw-r--r--src/ls.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/ls.c b/src/ls.c
index 4e044a93b..4b69f7d22 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -91,7 +91,6 @@
#include "human.h"
#include "filemode.h"
#include "idcache.h"
-#include "inttostr.h"
#include "ls.h"
#include "lstat.h"
#include "mbswidth.h"
@@ -3596,9 +3595,7 @@ print_long_format (const struct fileinfo *f)
sprintf (p, "%*s ", long_time_expected_width (),
(! f->stat_ok
? "?"
- : (TYPE_SIGNED (time_t)
- ? imaxtostr (when_timespec.tv_sec, hbuf)
- : umaxtostr (when_timespec.tv_sec, hbuf))));
+ : timetostr (when_timespec.tv_sec, hbuf)));
/* FIXME: (maybe) We discarded when_timespec.tv_nsec. */
p += strlen (p);
}