Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/pax LC_TIME holds a locale name, which isn't a strftime(...



details:   https://anonhg.NetBSD.org/src/rev/d94bdaa3cf94
branches:  trunk
changeset: 498397:d94bdaa3cf94
user:      kleink <kleink%NetBSD.org@localhost>
date:      Sun Oct 22 15:41:31 2000 +0000

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

diffstat:

 bin/pax/extern.h   |   3 +--
 bin/pax/gen_subs.c |  36 +++++++++++++-----------------------
 bin/pax/pax.c      |  12 ++----------
 3 files changed, 16 insertions(+), 35 deletions(-)

diffs (121 lines):

diff -r 5897deb3b186 -r d94bdaa3cf94 bin/pax/extern.h
--- a/bin/pax/extern.h  Sun Oct 22 15:06:52 2000 +0000
+++ b/bin/pax/extern.h  Sun Oct 22 15:41:31 2000 +0000
@@ -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 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 -r 5897deb3b186 -r d94bdaa3cf94 bin/pax/gen_subs.c
--- a/bin/pax/gen_subs.c        Sun Oct 22 15:06:52 2000 +0000
+++ b/bin/pax/gen_subs.c        Sun Oct 22 15:41:31 2000 +0000
@@ -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 @@
        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 @@
        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 -r 5897deb3b186 -r d94bdaa3cf94 bin/pax/pax.c
--- a/bin/pax/pax.c     Sun Oct 22 15:06:52 2000 +0000
+++ b/bin/pax/pax.c     Sun Oct 22 15:41:31 2000 +0000
@@ -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 @@
 #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    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 */
 
@@ -359,13 +358,6 @@
        }
 
        /*
-        * 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
         * deal with any file size limit thorugh failed writes. Cpu time



Home | Main Index | Thread Index | Old Index