mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
(show_date): Rename local `time_format' so as not to
shadow the file-scoped global by that name.
This commit is contained in:
1 parent
ae08ebecae
commit
c8e4886304
1 file changed
+6
-6
@@ -399,20 +399,20 @@ hash_init (void)
|
||||
xalloc_die ();
|
||||
}
|
||||
|
||||
/* Display the date and time in PDUI according to the format specified
|
||||
/* Display the date and time in WHEN/NSEC according to the format specified
|
||||
in TIME_FORMAT. If TIME_FORMAT is NULL, use the standard output format.
|
||||
Return zero if successful. */
|
||||
|
||||
static int
|
||||
show_date (const char *time_format, time_t when, int nsec)
|
||||
show_date (const char *format, time_t when, int nsec)
|
||||
{
|
||||
struct tm *tm;
|
||||
char *out = NULL;
|
||||
size_t out_length = 0;
|
||||
|
||||
if (time_format == NULL || *time_format == '\0')
|
||||
if (format == NULL || *format == '\0')
|
||||
{
|
||||
time_format = "%Y-%m-%d %H:%M";
|
||||
format = "%Y-%m-%d %H:%M";
|
||||
}
|
||||
|
||||
tm = localtime (&when);
|
||||
@@ -429,7 +429,7 @@ show_date (const char *time_format, time_t when, int nsec)
|
||||
|
||||
while (1)
|
||||
{
|
||||
int done;
|
||||
bool done;
|
||||
out = x2nrealloc (out, &out_length, sizeof *out);
|
||||
|
||||
/* Mark the first byte of the buffer so we can detect the case
|
||||
@@ -438,7 +438,7 @@ show_date (const char *time_format, time_t when, int nsec)
|
||||
`LANG=de date +%p' on a system with good language support. */
|
||||
out[0] = '\1';
|
||||
|
||||
done = (nstrftime (out, out_length, time_format, tm, 0, nsec)
|
||||
done = (nstrftime (out, out_length, format, tm, 0, nsec)
|
||||
|| out[0] == '\0');
|
||||
|
||||
if (done)
|
||||
|
||||
Reference in new issue
Block a user