LC_TIME holds a locale name, which isn't a strftime() format string.

This commit is contained in:
kleink 2000-10-22 15:41:31 +00:00
parent 9ff4b1c139
commit a8e69293b0
3 changed files with 16 additions and 35 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: extern.h,v 1.24 2000/07/04 17:17:49 thorpej Exp $ */
/* $NetBSD: extern.h,v 1.25 2000/10/22 15:41:31 kleink Exp $ */
/*-
* Copyright (c) 1992 Keith Muller.
@ -243,7 +243,6 @@ extern int pids;
extern int exit_val;
extern int docrc;
extern char *dirptr;
extern const char *ltmfrmt;
extern char *argv0;
int main __P((int, char **));
void sig_cleanup __P((int));

View File

@ -1,4 +1,4 @@
/* $NetBSD: gen_subs.c,v 1.18 2000/06/17 18:19:10 mrg Exp $ */
/* $NetBSD: gen_subs.c,v 1.19 2000/10/22 15:41:31 kleink Exp $ */
/*-
* Copyright (c) 1992 Keith Muller.
@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)gen_subs.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: gen_subs.c,v 1.18 2000/06/17 18:19:10 mrg Exp $");
__RCSID("$NetBSD: gen_subs.c,v 1.19 2000/10/22 15:41:31 kleink Exp $");
#endif
#endif /* not lint */
@ -117,17 +117,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
@ -190,16 +186,10 @@ ls_tty(arcn)
char f_mode[MODELEN];
const 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

View File

@ -1,4 +1,4 @@
/* $NetBSD: pax.c,v 1.12 2000/02/17 03:12:25 itohy Exp $ */
/* $NetBSD: pax.c,v 1.13 2000/10/22 15:41:31 kleink Exp $ */
/*-
* Copyright (c) 1992 Keith Muller.
@ -47,7 +47,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 1993\n\
#if 0
static char sccsid[] = "@(#)pax.c 8.2 (Berkeley) 4/18/94";
#else
__RCSID("$NetBSD: pax.c,v 1.12 2000/02/17 03:12:25 itohy Exp $");
__RCSID("$NetBSD: pax.c,v 1.13 2000/10/22 15:41:31 kleink Exp $");
#endif
#endif /* not lint */
@ -100,7 +100,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 */
const char *ltmfrmt; /* -v locale time format (if any) */
char *argv0; /* root of argv[0] */
sigset_t s_mask; /* signal mask for cleanup critical sect */
@ -358,13 +357,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