]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update from tzcode1997c.
authorUlrich Drepper <drepper@redhat.com>
Mon, 17 Mar 1997 04:14:27 +0000 (04:14 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 17 Mar 1997 04:14:27 +0000 (04:14 +0000)
time/ialloc.c
time/private.h
time/scheck.c
time/tzfile.c
time/tzselect.ksh
time/zdump.c
time/zic.c

index 5631947d0718e15072d5d5c0c85486ddb5b84369..8a0c7015789022a3dbf82bdf2257bd8fb0512975 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef lint
 #ifndef NOID
-static char    elsieid[] = "@(#)ialloc.c       8.28";
+static char    elsieid[] = "@(#)ialloc.c       8.29";
 #endif /* !defined NOID */
 #endif /* !defined lint */
 
@@ -10,13 +10,6 @@ static char  elsieid[] = "@(#)ialloc.c       8.28";
 
 #define nonzero(n)     (((n) == 0) ? 1 : (n))
 
-char * icalloc P((int nelem, int elsize));
-char * icatalloc P((char * old, const char * new));
-char * icpyalloc P((const char * string));
-char * imalloc P((int n));
-void * irealloc P((void * pointer, int size));
-void   ifree P((char * pointer));
-
 char *
 imalloc(n)
 const int      n;
index f81bf4867bdbb27a735161607a0bb820fd8ee607..5502aa8c981eecab8c98131fa9f7fa7654691b02 100644 (file)
@@ -4,7 +4,7 @@
 
 /*
 ** This file is in the public domain, so clarified as of
-** June 5, 1996 by Arthur David Olson (arthur_david_olson@nih.gov).
+** 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
 */
 
 /*
@@ -21,7 +21,7 @@
 
 #ifndef lint
 #ifndef NOID
-static char    privatehid[] = "@(#)private.h   7.43";
+static char    privatehid[] = "@(#)private.h   7.45";
 #endif /* !defined NOID */
 #endif /* !defined lint */
 
@@ -172,6 +172,18 @@ extern int unlink P((const char * filename));
 extern int errno;
 #endif /* !defined errno */
 
+/*
+** Private function declarations.
+*/
+char * icalloc P((int nelem, int elsize));
+char * icatalloc P((char * old, const char * const new));
+char * icpyalloc P((const char * const string));
+char * imalloc P((const int n));
+void * irealloc P((void * const pointer, const int size));
+void   icfree P((char * const pointer));
+void   ifree P((char * const pointer));
+char * scheck P((const char * const string, const char * const format));
+
 /*
 ** Finally, some convenience items.
 */
index 64f25076edc1b9782f4401509ef1b6695900797d..52b4ff51fd9dc29207f5188afd3dee92f5291ef8 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef lint
 #ifndef NOID
-static char    elsieid[] = "@(#)scheck.c       8.13";
+static char    elsieid[] = "@(#)scheck.c       8.14";
 #endif /* !defined lint */
 #endif /* !defined NOID */
 
@@ -8,13 +8,10 @@ static char   elsieid[] = "@(#)scheck.c       8.13";
 
 #include "private.h"
 
-extern char *  imalloc P((int n));
-extern void    ifree P((char * p));
-
 char *
 scheck(string, format)
 const char * const     string;
-char * const           format;
+const char * const     format;
 {
        register char *         fbuf;
        register const char *   fp;
index 94b8a3c8fe1f3613546baa83c2c3076ebdc1276a..44b33cb02c5c81794064e51177f6c00f4d0608d9 100644 (file)
@@ -120,7 +120,7 @@ __tzfile_read (const char *file)
         and which is not the system wide default TZDEFAULT.  */
       if (__libc_enable_secure
          && ((*file == '/'
-              && memcmp (file, TZDEFAULT, sizeof (TZDEFAULT) - 1)
+              && memcmp (file, TZDEFAULT, sizeof TZDEFAULT)
               && memcmp (file, default_tzdir, sizeof (default_tzdir) - 1))
              || strstr (file, "../") != NULL))
        /* This test is certainly a bit too restrictive but it should
index 33bdbc7431c61ab51cac36c49077f2267dc845ce..031cda1de6a006dc2df1180773d0652f18098fcd 100644 (file)
 # you can use either of the following free programs instead:
 #
 #      Bourne-Again shell (bash)
-#      <URL:ftp://prep.ai.mit.edu:/pub/gnu/bash-2.0.tar.gz>
-#      (or any later version)
+#      <URL:ftp://ftp.gnu.ai.mit.edu/pub/gnu/>
 #
 #      Public domain ksh
-#      <URL:ftp://ftp.cs.mun.ca:/pub/pdksh/pdksh.tar.gz>
+#      <URL:ftp://ftp.cs.mun.ca/pub/pdksh/pdksh.tar.gz>
 #
 # This script also uses several features of modern awk programs.
 # If your host lacks awk, or has an old awk that does not conform to Posix.2,
 # you can use either of the following free programs instead:
 #
 #      GNU awk (gawk)
-#      <URL:ftp://prep.ai.mit.edu:/pub/gnu/gawk-3.0.2.tar.gz>
-#      (or any later version)
+#      <URL:ftp://ftp.gnu.ai.mit.edu/pub/gnu/>
 #
 #      mawk
-#      <URL:ftp://oxy.edu/public/mawk1.2.2.tar.gz>
-#      (or any later version)
+#      <URL:ftp://ftp.whidbey.net/pub/brennan/>
 
 
 # Specify default values for environment variables if they are unset.
@@ -57,7 +54,7 @@ newline='
 IFS=$newline
 
 
-# Work around a bash bug, where $PS3 is sent to stdout.
+# Work around a bug in bash 1.14.7 and earlier, where $PS3 is sent to stdout.
 case $(echo 1 | (select x in x; do break; done) 2>/dev/null) in
 ?*) PS3=
 esac
index e5ed82f1044d0c5ac9436c932817c3fe8d0d5ef4..01c79ca7fb58c21535ac31443701074e608d63c2 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef lint
 #ifndef NOID
-static char    elsieid[] = "@(#)zdump.c        7.25";
+static char    elsieid[] = "@(#)zdump.c        7.26";
 #endif /* !defined NOID */
 #endif /* !defined lint */
 
@@ -111,19 +111,28 @@ static char       elsieid[] = "@(#)zdump.c        7.25";
 #define TZ_DOMAIN "tz"
 #endif /* !defined TZ_DOMAIN */
 
+#ifndef P
+#ifdef __STDC__
+#define P(x)   x
+#endif /* defined __STDC__ */
+#ifndef __STDC__
+#define P(x)   ()
+#endif /* !defined __STDC__ */
+#endif /* !defined P */
+
 extern char ** environ;
-extern int     getopt();
+extern int     getopt P((int argc, char * const argv[],
+                         const char * options));
 extern char *  optarg;
 extern int     optind;
-extern time_t  time();
 extern char *  tzname[2];
 
-static char *  abbr();
-static long    delta();
-static time_t  hunt();
-static int     longest;
+static char *  abbr P((struct tm * tmp));
+static long    delta P((struct tm * newp, struct tm * oldp));
+static time_t  hunt P((char * name, time_t lot, time_t hit));
+static size_t  longest;
 static char *  progname;
-static void    show();
+static void    show P((char * zone, time_t t, int v));
 
 int
 main(argc, argv)
@@ -191,8 +200,7 @@ _("%s: usage is %s [ -v ] [ -c cutoff ] zonename ...\n"),
                fakeenv = (char **) malloc((size_t) ((i + 2) *
                        sizeof *fakeenv));
                if (fakeenv == NULL ||
-                       (fakeenv[0] = (char *) malloc((size_t) (longest +
-                               4))) == NULL) {
+                       (fakeenv[0] = (char *) malloc(longest + 4)) == NULL) {
                                        (void) perror(progname);
                                        (void) exit(EXIT_FAILURE);
                }
@@ -326,8 +334,6 @@ struct tm * oldp;
        return result;
 }
 
-extern struct tm *     localtime();
-
 static void
 show(zone, t, v)
 char * zone;
@@ -336,7 +342,7 @@ int v;
 {
        struct tm *     tmp;
 
-       (void) printf("%-*s  ", longest, zone);
+       (void) printf("%-*s  ", (int) longest, zone);
        if (v)
                (void) printf("%.24s GMT = ", asctime(gmtime(&t)));
        tmp = localtime(&t);
index c4c9a3ae25c038f46fca8d27773468b3ff5e020f..b9518c4649d52b3b019d82ba88f942b6fe3b5a94 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef lint
 #ifndef NOID
-static char    elsieid[] = "@(#)zic.c  7.82";
+static char    elsieid[] = "@(#)zic.c  7.83";
 #endif /* !defined NOID */
 #endif /* !defined lint */
 
@@ -79,15 +79,9 @@ struct zone {
 
 extern int     getopt P((int argc, char * const argv[],
                        const char * options));
-extern char *  icatalloc P((char * old, const char * new));
-extern char *  icpyalloc P((const char * string));
-extern void    ifree P((char * p));
-extern char *  imalloc P((int n));
-extern void *  irealloc P((void * old, int n));
 extern int     link P((const char * fromname, const char * toname));
 extern char *  optarg;
 extern int     optind;
-extern char *  scheck P((const char * string, const char * format));
 
 static void    addtt P((time_t starttime, int type));
 static int     addtype P((long gmtoff, const char * abbr, int isdst,
@@ -1289,6 +1283,8 @@ const char * const                timep;
                }
                rp->r_yrtype = ecpyalloc(typep);
        }
+       if (rp->r_loyear < min_year && rp->r_loyear > 0)
+               min_year = rp->r_loyear;
        /*
        ** Day work.
        ** Accept things such as:
@@ -1397,8 +1393,10 @@ const char * const       name;
 
                toi = 0;
                fromi = 0;
+               while (fromi < timecnt && attypes[fromi].at < min_time)
+                       ++fromi;
                if (isdsts[0] == 0)
-                       while (attypes[fromi].type == 0)
+                       while (fromi < timecnt && attypes[fromi].type == 0)
                                ++fromi;        /* handled by default rule */
                for ( ; fromi < timecnt; ++fromi) {
                        if (toi != 0
@@ -1723,8 +1721,22 @@ error(_("can't determine time zone abbreviation to use just after until time"));
 static void
 addtt(starttime, type)
 const time_t   starttime;
-const int      type;
+int            type;
 {
+       if (starttime <= min_time ||
+               (timecnt == 1 && attypes[0].at < min_time)) {
+               gmtoffs[0] = gmtoffs[type];
+               isdsts[0] = isdsts[type];
+               ttisstds[0] = ttisstds[type];
+               ttisgmts[0] = ttisgmts[type];
+               if (abbrinds[type] != 0)
+                       (void) strcpy(chars, &chars[abbrinds[type]]);
+               abbrinds[0] = 0;
+               charcnt = strlen(chars) + 1;
+               typecnt = 1;
+               timecnt = 0;
+               type = 0;
+       }
        if (timecnt >= TZ_MAX_TIMES) {
                error(_("too many transitions?!"));
                (void) exit(EXIT_FAILURE);
@@ -2130,7 +2142,7 @@ char * const      argname;
                        ** created by some other multiprocessor, so we get
                        ** to do extra checking.
                        */
-                       if (mkdir(name, 0755) != 0) {
+                       if (mkdir(name, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) != 0) {
                                const char *e = strerror(errno);
 
                                if (errno != EEXIST || !itsdir(name)) {