diff options
| author | Paul Eggert <eggert@cs.ucla.edu> | 2025-11-01 17:39:07 -0600 |
|---|---|---|
| committer | Paul Eggert <eggert@cs.ucla.edu> | 2025-11-01 18:00:32 -0600 |
| commit | b427c185f266f5ab549e311a3c26a179d51f7d35 (patch) | |
| tree | dd5df129739d7501722fbae56f3e8c2ee0846c49 | |
| parent | build: update gnulib submodule to latest (diff) | |
| download | coreutils-b427c185f266f5ab549e311a3c26a179d51f7d35.tar.gz coreutils-b427c185f266f5ab549e311a3c26a179d51f7d35.zip | |
ls: better nstrftime failure check
* src/ls.c (print_long_format): Streamline the checking
for failure of nstrftime.
| -rw-r--r-- | src/ls.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -4422,8 +4422,7 @@ print_long_format (const struct fileinfo *f) p[-1] = ' '; } - s = 0; - *p = '\1'; + s = -1; if (f->stat_ok && btime_ok && localtime_rz (localtz, &when_timespec.tv_sec, &when_local)) @@ -4451,11 +4450,9 @@ print_long_format (const struct fileinfo *f) whole number of seconds. */ s = align_nstrftime (p, TIME_STAMP_LEN_MAXIMUM + 1, recent, &when_local, localtz, when_timespec.tv_nsec); - if (s < 0) - s = 0; } - if (s || !*p) + if (0 <= s) { p += s; *p++ = ' '; |
