[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#7325: new test failure due to non-portability of printf formats like
From: |
Jim Meyering |
Subject: |
bug#7325: new test failure due to non-portability of printf formats like %05.3s |
Date: |
Sat, 06 Nov 2010 10:21:03 +0100 |
Paul Eggert wrote:
...
> Subject: [PATCH] stat: use e.g. %.3X instead of %X.%3:X for sub-second
> precision
Thanks again.
Here's one more small change I'm including, to
put braces around this four-line "for"-loop body:
[per HACKING's "Curly braces" guidelines]
diff --git a/src/stat.c b/src/stat.c
index cbf6d25..99f115b 100644
--- a/src/stat.c
+++ b/src/stat.c
@@ -562,10 +562,12 @@ out_epoch_sec (char *pformat, size_t prefix_len, struct
stat const *statbuf,
{
char *dst = pformat;
for (char const *src = dst; src < p; src++)
- if (*src == '-')
- frac_left_adjust = true;
- else
- *dst++ = *src;
+ {
+ if (*src == '-')
+ frac_left_adjust = true;
+ else
+ *dst++ = *src;
+ }
sec_prefix_len =
(dst - pformat
+ (frac_left_adjust ? 0 : sprintf (dst, "%d", w)));
- bug#7325: new test failure due to non-portability of printf formats like %05.3s, (continued)
- bug#7325: new test failure due to non-portability of printf formats like %05.3s, Jim Meyering, 2010/11/04
- bug#7325: new test failure due to non-portability of printf formats like %05.3s, Jim Meyering, 2010/11/04
- bug#7325: new test failure due to non-portability of printf formats like %05.3s, Paul Eggert, 2010/11/04
- bug#7325: new test failure due to non-portability of printf formats like %05.3s, Jim Meyering, 2010/11/04
- bug#7325: new test failure due to non-portability of printf formats like %05.3s, Jim Meyering, 2010/11/05
- bug#7325: new test failure due to non-portability of printf formats like %05.3s, Paul Eggert, 2010/11/05
- bug#7325: new test failure due to non-portability of printf formats like %05.3s, Pádraig Brady, 2010/11/04
- bug#7325: new test failure due to non-portability of printf formats like %05.3s, Jim Meyering, 2010/11/05
- bug#7325: new test failure due to non-portability of printf formats like %05.3s, Paul Eggert, 2010/11/05
- bug#7325: new test failure due to non-portability of printf formats like %05.3s, Jim Meyering, 2010/11/06
- bug#7325: new test failure due to non-portability of printf formats like %05.3s,
Jim Meyering <=
- bug#7325: new test failure due to non-portability of printf formats like %05.3s, Pádraig Brady, 2010/11/06
- bug#7325: new test failure due to non-portability of printf formats like %05.3s, Pádraig Brady, 2010/11/08
- bug#7325: new test failure due to non-portability of printf formats like %05.3s, Jim Meyering, 2010/11/08
- bug#7325: new test failure due to non-portability of printf formats like %05.3s, Pádraig Brady, 2010/11/08
- bug#7325: new test failure due to non-portability of printf formats like %05.3s, Jim Meyering, 2010/11/08
- bug#7325: new test failure due to non-portability of printf formats like %05.3s, Eric Blake, 2010/11/08
- bug#7325: new test failure due to non-portability of printf formats like %05.3s, Paul Eggert, 2010/11/08
- bug#7325: new test failure due to non-portability of printf formats like %05.3s, Jim Meyering, 2010/11/09
- bug#7325: new test failure due to non-portability of printf formats like %05.3s, Jim Meyering, 2010/11/10
- bug#7325: new test failure due to non-portability of printf formats like %05.3s, Paul Eggert, 2010/11/11