From a8e69293b06422155e17ac97e8299d4d182f07d8 Mon Sep 17 00:00:00 2001 From: kleink Date: Sun, 22 Oct 2000 15:41:31 +0000 Subject: [PATCH] LC_TIME holds a locale name, which isn't a strftime() format string. --- bin/pax/extern.h | 3 +-- bin/pax/gen_subs.c | 36 +++++++++++++----------------------- bin/pax/pax.c | 12 ++---------- 3 files changed, 16 insertions(+), 35 deletions(-) diff --git a/bin/pax/extern.h b/bin/pax/extern.h index d1b41a18bc64..94f62671312c 100644 --- a/bin/pax/extern.h +++ b/bin/pax/extern.h @@ -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)); diff --git a/bin/pax/gen_subs.c b/bin/pax/gen_subs.c index 60430d185024..c3fb3b791edc 100644 --- a/bin/pax/gen_subs.c +++ b/bin/pax/gen_subs.c @@ -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 diff --git a/bin/pax/pax.c b/bin/pax/pax.c index efae10e490d9..153809b61f15 100644 --- a/bin/pax/pax.c +++ b/bin/pax/pax.c @@ -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