POSIX wrote:
: LC_TIME This variable shall determine the format and : contents of date and time strings when the -v : option is specified. Developers took this wrong. LC_TIME specifies the locale name, not the ``format'' argument of strftime(). Oops: pax -w -f /tmp/foo /dev/null LC_TIME=de_DE.ISO_8859-1 pax -v -f /tmp/foo
This commit is contained in:
parent
fbedc11796
commit
7a6be91366
@ -223,7 +223,6 @@ extern int pids;
|
||||
extern int exit_val;
|
||||
extern int docrc;
|
||||
extern char *dirptr;
|
||||
extern char *ltmfrmt;
|
||||
extern char *argv0;
|
||||
int main __P((int, char **));
|
||||
void sig_cleanup __P((int));
|
||||
|
@ -106,17 +106,13 @@ ls_list(arcn, now)
|
||||
sbp = &(arcn->sb);
|
||||
strmode(sbp->st_mode, f_mode);
|
||||
|
||||
if (ltmfrmt == NULL) {
|
||||
/*
|
||||
* no locale specified format. time format based on age
|
||||
* compared to the time pax was started.
|
||||
*/
|
||||
if ((sbp->st_mtime + SIXMONTHS) <= now)
|
||||
timefrmt = OLDFRMT;
|
||||
else
|
||||
timefrmt = CURFRMT;
|
||||
} else
|
||||
timefrmt = ltmfrmt;
|
||||
/*
|
||||
* time format based on age compared to the time pax was started.
|
||||
*/
|
||||
if ((sbp->st_mtime + SIXMONTHS) <= now)
|
||||
timefrmt = OLDFRMT;
|
||||
else
|
||||
timefrmt = CURFRMT;
|
||||
|
||||
/*
|
||||
* print file mode, link count, uid, gid and time
|
||||
@ -178,16 +174,10 @@ ls_tty(arcn)
|
||||
char f_mode[MODELEN];
|
||||
char *timefrmt;
|
||||
|
||||
if (ltmfrmt == NULL) {
|
||||
/*
|
||||
* no locale specified format
|
||||
*/
|
||||
if ((arcn->sb.st_mtime + SIXMONTHS) <= time((time_t *)NULL))
|
||||
timefrmt = OLDFRMT;
|
||||
else
|
||||
timefrmt = CURFRMT;
|
||||
} else
|
||||
timefrmt = ltmfrmt;
|
||||
if ((arcn->sb.st_mtime + SIXMONTHS) <= time((time_t *)NULL))
|
||||
timefrmt = OLDFRMT;
|
||||
else
|
||||
timefrmt = CURFRMT;
|
||||
|
||||
/*
|
||||
* convert time to string, and print
|
||||
|
@ -95,7 +95,6 @@ int pids; /* preserve file uid/gid */
|
||||
int exit_val; /* exit value */
|
||||
int docrc; /* check/create file crc */
|
||||
char *dirptr; /* destination dir in a copy */
|
||||
char *ltmfrmt; /* -v locale time format (if any) */
|
||||
char *argv0; /* root of argv[0] */
|
||||
sigset_t s_mask; /* signal mask for cleanup critical sect */
|
||||
|
||||
@ -349,13 +348,6 @@ gen_init()
|
||||
(void)setrlimit(RLIMIT_RSS , &reslimit);
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle posix locale
|
||||
*
|
||||
* set user defines time printing format for -v option
|
||||
*/
|
||||
ltmfrmt = getenv("LC_TIME");
|
||||
|
||||
/*
|
||||
* signal handling to reset stored directory times and modes. Since
|
||||
* we deal with broken pipes via failed writes we ignore it. We also
|
||||
|
Loading…
x
Reference in New Issue
Block a user