Proposed minor cleanups

Olson, Arthur David (NIH/NCI) olsona at dc37a.nci.nih.gov
Thu Feb 3 15:19:02 UTC 2005


Below are proposed minor cleanups for the time zone code.

1. There's a change to the declarations of the "scheck" function to avoid a
lint gripe.
2. Preprocessor directives of the form
	#if WHATEVER - 0
   have been changed to the form
	#if WHATEVER
   under the assumption that we're working with ANSI standard compilers.
3. The underscored variants of definitions of constants such as 
	SECSPERDAY
   have been eliminated, in line with a long-standing comment in the code.
4. And the bulk of the changes are cleanups to white space and line lengths.

				--ado

diff -r -c old/Makefile new/Makefile
*** old/Makefile	Mon Jan 31 09:21:22 2005
--- new/Makefile	Mon Jan 31 14:06:12 2005
***************
*** 1,4 ****
! # @(#)Makefile	7.106
  
  # Change the line below for your time zone (after finding the zone you
want in
  # the time zone files, or adding it to a time zone file).
--- 1,4 ----
! # @(#)Makefile	7.107
  
  # Change the line below for your time zone (after finding the zone you
want in
  # the time zone files, or adding it to a time zone file).
***************
*** 398,404 ****
  		tar cf - $(DOCS) $(SOURCES) $(MISC) *.[1-8].txt | gzip -9 >
tzcode.tar.gz
  		tar cf - $(DATA) | gzip -9 > tzdata.tar.gz
  
! typecheck:	
  		make clean
  		for i in "long long" unsigned double; \
  		do \
--- 398,404 ----
  		tar cf - $(DOCS) $(SOURCES) $(MISC) *.[1-8].txt | gzip -9 >
tzcode.tar.gz
  		tar cf - $(DATA) | gzip -9 > tzdata.tar.gz
  
! typecheck:
  		make clean
  		for i in "long long" unsigned double; \
  		do \
diff -r -c old/asctime.c new/asctime.c
*** old/asctime.c	Mon Jan 31 09:20:46 2005
--- new/asctime.c	Mon Jan 31 14:06:49 2005
***************
*** 11,17 ****
  
  #ifndef lint
  #ifndef NOID
! static char	elsieid[] = "@(#)asctime.c	7.30";
  #endif /* !defined NOID */
  #endif /* !defined lint */
  
--- 11,17 ----
  
  #ifndef lint
  #ifndef NOID
! static char	elsieid[] = "@(#)asctime.c	7.31";
  #endif /* !defined NOID */
  #endif /* !defined lint */
  
***************
*** 98,104 ****
  	/*
  	** We avoid using snprintf since it's not available on all systems.
  	*/
! 	(void) sprintf(result, 
  		((strlen(year) <= 4) ? ASCTIME_FMT : ASCTIME_FMT_B),
  		wn, mn,
  		timeptr->tm_mday, timeptr->tm_hour,
--- 98,104 ----
  	/*
  	** We avoid using snprintf since it's not available on all systems.
  	*/
! 	(void) sprintf(result,
  		((strlen(year) <= 4) ? ASCTIME_FMT : ASCTIME_FMT_B),
  		wn, mn,
  		timeptr->tm_mday, timeptr->tm_hour,
diff -r -c old/asia new/asia
*** old/asia	Mon Jan 17 18:36:16 2005
--- new/asia	Mon Jan 31 14:06:50 2005
***************
*** 1,4 ****
! # @(#)asia	7.78
  
  # This data is by no means authoritative; if you think you know better,
  # go ahead and edit the file (and please send any changes to
--- 1,4 ----
! # @(#)asia	7.79
  
  # This data is by no means authoritative; if you think you know better,
  # go ahead and edit the file (and please send any changes to
***************
*** 337,343 ****
  # President Eduard Shevardnadze decreed Wednesday.
  #
  # From the BBC via Joseph S. Myers (2004-06-27):
! #  	
  # Georgia moved closer to Western Europe on Sunday...  The former Soviet
  # republic has changed its time zone back to that of Moscow.  As a result
it
  # is now just four hours ahead of Greenwich Mean Time, rather than five
hours
--- 337,343 ----
  # President Eduard Shevardnadze decreed Wednesday.
  #
  # From the BBC via Joseph S. Myers (2004-06-27):
! #
  # Georgia moved closer to Western Europe on Sunday...  The former Soviet
  # republic has changed its time zone back to that of Moscow.  As a result
it
  # is now just four hours ahead of Greenwich Mean Time, rather than five
hours
diff -r -c old/date.c new/date.c
*** old/date.c	Mon Jan 31 09:20:47 2005
--- new/date.c	Mon Jan 31 14:06:49 2005
***************
*** 1,6 ****
  #ifndef lint
  #ifndef NOID
! static char	elsieid[] = "@(#)date.c	7.40";
  /*
  ** Modified from the UCB version with the SCCS ID appearing below.
  */
--- 1,6 ----
  #ifndef lint
  #ifndef NOID
! static char	elsieid[] = "@(#)date.c	7.41";
  /*
  ** Modified from the UCB version with the SCCS ID appearing below.
  */
***************
*** 664,670 ****
  	cp = value;
  	switch (dotp - cp) {
  		default:
! 			wildinput(_("time"), value, _("main part is wrong
length"));
  		case 12:
  			if (!dousg) {
  				cent = ATOI2(cp);
--- 664,671 ----
  	cp = value;
  	switch (dotp - cp) {
  		default:
! 			wildinput(_("time"), value,
! 				_("main part is wrong length"));
  		case 12:
  			if (!dousg) {
  				cent = ATOI2(cp);
diff -r -c old/difftime.c new/difftime.c
*** old/difftime.c	Mon Jan 31 09:20:47 2005
--- new/difftime.c	Mon Jan 31 14:06:49 2005
***************
*** 5,11 ****
  
  #ifndef lint
  #ifndef NOID
! static char	elsieid[] = "@(#)difftime.c	7.17";
  #endif /* !defined NOID */
  #endif /* !defined lint */
  
--- 5,11 ----
  
  #ifndef lint
  #ifndef NOID
! static char	elsieid[] = "@(#)difftime.c	7.18";
  #endif /* !defined NOID */
  #endif /* !defined lint */
  
***************
*** 57,63 ****
  	/*
  	** Stay calm...decent optimizers will eliminate the complexity
below.
  	*/
! 	if (time1 >= 0 /* && time0 < 0 */) 
  		return (unsigned long) time1 +
  			(unsigned long) (-(time0 + 1)) + 1;
  	return -(double) ((unsigned long) time0 +
--- 57,63 ----
  	/*
  	** Stay calm...decent optimizers will eliminate the complexity
below.
  	*/
! 	if (time1 >= 0 /* && time0 < 0 */)
  		return (unsigned long) time1 +
  			(unsigned long) (-(time0 + 1)) + 1;
  	return -(double) ((unsigned long) time0 +
diff -r -c old/leapseconds new/leapseconds
*** old/leapseconds	Mon Jan 17 18:36:18 2005
--- new/leapseconds	Mon Jan 31 14:06:50 2005
***************
*** 1,4 ****
! # @(#)leapseconds	7.18
  
  # Allowance for leapseconds added to each timezone file.
  
--- 1,4 ----
! # @(#)leapseconds	7.19
  
  # Allowance for leapseconds added to each timezone file.
  
***************
*** 44,52 ****
  Leap	1997	Jun	30	23:59:60	+	S
  Leap	1998	Dec	31	23:59:60	+	S
  
! # 	INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE (IERS)
  # SERVICE INTERNATIONAL DE LA ROTATION TERRESTRE ET DES SYSTEMES DE
REFERENCE
! # 
  # SERVICE DE LA ROTATION TERRESTRE
  # OBSERVATOIRE DE PARIS
  # 61, Av. de l'Observatoire 75014 PARIS (France)
--- 44,52 ----
  Leap	1997	Jun	30	23:59:60	+	S
  Leap	1998	Dec	31	23:59:60	+	S
  
! #	INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE (IERS)
  # SERVICE INTERNATIONAL DE LA ROTATION TERRESTRE ET DES SYSTEMES DE
REFERENCE
! #
  # SERVICE DE LA ROTATION TERRESTRE
  # OBSERVATOIRE DE PARIS
  # 61, Av. de l'Observatoire 75014 PARIS (France)
***************
*** 53,80 ****
  # Tel.      : 33 (0) 1 40 51 22 26
  # FAX       : 33 (0) 1 40 51 22 91
  # Internet  : services.iers at obspm.fr
! # 
! # 						Paris, 21 July 2004
! # 
! # 
! # 						Bulletin C 28
! # 
! # 						To authorities responsible
! # 						for the measurement and
! # 						distribution of time
! # 
! # 			INFORMATION ON UTC - TAI
! # 
  # NO positive leap second will be introduced at the end of December 2004.
  # The difference between UTC and the International Atomic Time TAI is:
! # 
! # 	from 1999 January 1, 0h UTC, until further notice : UTC-TAI = -32 s
! # 
  # Leap seconds can be introduced in UTC at the end of the months of
December
  # or June, depending on the evolution of UT1-TAI. Bulletin C is mailed
every
  # six months, either to announce a time step in UTC, or to confirm that
there
  # will be no time step at the next possible date.
! # 
! # 					Daniel GAMBIS
! # 					Director
! # 					Earth Orientation Center of IERS
--- 53,80 ----
  # Tel.      : 33 (0) 1 40 51 22 26
  # FAX       : 33 (0) 1 40 51 22 91
  # Internet  : services.iers at obspm.fr
! #
! #						Paris, 21 July 2004
! #
! #
! #						Bulletin C 28
! #
! #						To authorities responsible
! #						for the measurement and
! #						distribution of time
! #
! #			INFORMATION ON UTC - TAI
! #
  # NO positive leap second will be introduced at the end of December 2004.
  # The difference between UTC and the International Atomic Time TAI is:
! #
! #	from 1999 January 1, 0h UTC, until further notice : UTC-TAI = -32 s
! #
  # Leap seconds can be introduced in UTC at the end of the months of
December
  # or June, depending on the evolution of UT1-TAI. Bulletin C is mailed
every
  # six months, either to announce a time step in UTC, or to confirm that
there
  # will be no time step at the next possible date.
! #
! #					Daniel GAMBIS
! #					Director
! #					Earth Orientation Center of IERS
diff -r -c old/localtime.c new/localtime.c
*** old/localtime.c	Mon Jan 31 09:20:46 2005
--- new/localtime.c	Mon Jan 31 14:09:31 2005
***************
*** 5,11 ****
  
  #ifndef lint
  #ifndef NOID
! static char	elsieid[] = "@(#)localtime.c	7.90";
  #endif /* !defined NOID */
  #endif /* !defined lint */
  
--- 5,11 ----
  
  #ifndef lint
  #ifndef NOID
! static char	elsieid[] = "@(#)localtime.c	7.91";
  #endif /* !defined NOID */
  #endif /* !defined lint */
  
***************
*** 47,55 ****
  **	5.	They might reference tm.TM_ZONE after calling offtime.
  ** What's best to do in the above cases is open to debate;
  ** for now, we just set things up so that in any of the five cases
! ** WILDABBR is used.  Another possibility:  initialize tzname[0] to the
  ** string "tzname[0] used before set", and similarly for the other cases.
! ** And another:  initialize tzname[0] to "ERA", with an explanation in the
  ** manual page of what this "time zone abbreviation" means (doing this so
  ** that tzname[0] has the "normal" length of three characters).
  */
--- 47,55 ----
  **	5.	They might reference tm.TM_ZONE after calling offtime.
  ** What's best to do in the above cases is open to debate;
  ** for now, we just set things up so that in any of the five cases
! ** WILDABBR is used. Another possibility: initialize tzname[0] to the
  ** string "tzname[0] used before set", and similarly for the other cases.
! ** And another: initialize tzname[0] to "ERA", with an explanation in the
  ** manual page of what this "time zone abbreviation" means (doing this so
  ** that tzname[0] has the "normal" length of three characters).
  */
***************
*** 453,459 ****
  
  /*
  ** Given a pointer into a time zone string, scan until a character that is
not
! ** a valid character in a zone name is found.  Return a pointer to that
  ** character.
  */
  
--- 453,459 ----
  
  /*
  ** Given a pointer into a time zone string, scan until a character that is
not
! ** a valid character in a zone name is found. Return a pointer to that
  ** character.
  */
  
***************
*** 534,540 ****
  		*secsp += num * SECSPERMIN;
  		if (*strp == ':') {
  			++strp;
! 			/* `SECSPERMIN' allows for leap seconds.  */
  			strp = getnum(strp, &num, 0, SECSPERMIN);
  			if (strp == NULL)
  				return NULL;
--- 534,540 ----
  		*secsp += num * SECSPERMIN;
  		if (*strp == ':') {
  			++strp;
! 			/* `SECSPERMIN' allows for leap seconds. */
  			strp = getnum(strp, &num, 0, SECSPERMIN);
  			if (strp == NULL)
  				return NULL;
***************
*** 573,579 ****
  
  /*
  ** Given a pointer into a time zone string, extract a rule in the form
! ** date[/time].  See POSIX section 8 for the format of "date" and "time".
  ** If a valid rule is not found, return NULL.
  ** Otherwise, return a pointer to the first character not part of the
rule.
  */
--- 573,579 ----
  
  /*
  ** Given a pointer into a time zone string, extract a rule in the form
! ** date[/time]. See POSIX section 8 for the format of "date" and "time".
  ** If a valid rule is not found, return NULL.
  ** Otherwise, return a pointer to the first character not part of the
rule.
  */
***************
*** 692,698 ****
  			dow += DAYSPERWEEK;
  
  		/*
! 		** "dow" is the day-of-week of the first day of the month.
Get
  		** the day-of-month (zero-origin) of the first "dow" day of
the
  		** month.
  		*/
--- 692,698 ----
  			dow += DAYSPERWEEK;
  
  		/*
! 		** "dow" is the day-of-week of the first day of the month.
Get
  		** the day-of-month (zero-origin) of the first "dow" day of
the
  		** month.
  		*/
***************
*** 715,721 ****
  
  	/*
  	** "value" is the Epoch-relative time of 00:00:00 UTC on the day in
! 	** question.  To get the Epoch-relative time of the specified local
  	** time on that day, add the transition time and the current offset
  	** from UTC.
  	*/
--- 715,721 ----
  
  	/*
  	** "value" is the Epoch-relative time of 00:00:00 UTC on the day in
! 	** question. To get the Epoch-relative time of the specified local
  	** time on that day, add the transition time and the current offset
  	** from UTC.
  	*/
***************
*** 1022,1028 ****
  /*
  ** The easy way to behave "as if no library function calls" localtime
  ** is to not call it--so we drop its guts into "localsub", which can be
! ** freely called.  (And no, the PANS doesn't require the above behavior--
  ** but it *is* desirable.)
  **
  ** The unused offset argument is for the benefit of mktime variants.
--- 1022,1028 ----
  /*
  ** The easy way to behave "as if no library function calls" localtime
  ** is to not call it--so we drop its guts into "localsub", which can be
! ** freely called. (And no, the PANS doesn't require the above behavior--
  ** but it *is* desirable.)
  **
  ** The unused offset argument is for the benefit of mktime variants.
***************
*** 1178,1184 ****
  leaps_thru_end_of(y)
  register const int	y;
  {
! 	return (y >= 0) ?  (y / 4 - y / 100 + y / 400) :
  		-(leaps_thru_end_of(-(y + 1)) + 1);
  }
  
--- 1178,1184 ----
  leaps_thru_end_of(y)
  register const int	y;
  {
! 	return (y >= 0) ? (y / 4 - y / 100 + y / 400) :
  		-(leaps_thru_end_of(-(y + 1)) + 1);
  }
  
***************
*** 1302,1308 ****
  	tmp->tm_min = (int) (rem / SECSPERMIN);
  	/*
  	** A positive leap second requires a special
! 	** representation.  This uses "... ??:59:60" et seq.
  	*/
  	tmp->tm_sec = (int) (rem % SECSPERMIN) + hit;
  	ip = mon_lengths[isleap(y)];
--- 1302,1308 ----
  	tmp->tm_min = (int) (rem / SECSPERMIN);
  	/*
  	** A positive leap second requires a special
! 	** representation. This uses "... ??:59:60" et seq.
  	*/
  	tmp->tm_sec = (int) (rem % SECSPERMIN) + hit;
  	ip = mon_lengths[isleap(y)];
***************
*** 1323,1329 ****
  /*
  ** Section 4.12.3.2 of X3.159-1989 requires that
  **	The ctime function converts the calendar time pointed to by timer
! **	to local time in the form of a string.  It is equivalent to
  **		asctime(localtime(timer))
  */
  	return asctime(localtime(timep));
--- 1323,1329 ----
  /*
  ** Section 4.12.3.2 of X3.159-1989 requires that
  **	The ctime function converts the calendar time pointed to by timer
! **	to local time in the form of a string. It is equivalent to
  **		asctime(localtime(timer))
  */
  	return asctime(localtime(timep));
***************
*** 1344,1350 ****
  **	The "best" way to do mktime I think is based on an idea of Bob
  **	Kridle's (so its said...) from a long time ago.
  **	[kridle at xinet.com as of 1996-01-16.]
! **	It does a binary search of the time_t space.  Since time_t's are
  **	just 32 bits, its a max of 32 iterations (even at 64 bits it
  **	would still be very reasonable).
  */
--- 1344,1350 ----
  **	The "best" way to do mktime I think is based on an idea of Bob
  **	Kridle's (so its said...) from a long time ago.
  **	[kridle at xinet.com as of 1996-01-16.]
! **	It does a binary search of the time_t space. Since time_t's are
  **	just 32 bits, its a max of 32 iterations (even at 64 bits it
  **	would still be very reasonable).
  */
***************
*** 1494,1500 ****
  		return WRONG;
  	yourtm.tm_year = y;
  	if (yourtm.tm_year != y)
!  		return WRONG;
  	if (yourtm.tm_sec >= 0 && yourtm.tm_sec < SECSPERMIN)
  		saved_seconds = 0;
  	else if (y + TM_YEAR_BASE < EPOCH_YEAR) {
--- 1494,1500 ----
  		return WRONG;
  	yourtm.tm_year = y;
  	if (yourtm.tm_year != y)
! 		return WRONG;
  	if (yourtm.tm_sec >= 0 && yourtm.tm_sec < SECSPERMIN)
  		saved_seconds = 0;
  	else if (y + TM_YEAR_BASE < EPOCH_YEAR) {
***************
*** 1813,1819 ****
  	tzset();
  	/*
  	** For a positive leap second hit, the result
! 	** is not unique.  For a negative leap second
  	** hit, the corresponding time doesn't exist,
  	** so we return an adjacent second.
  	*/
--- 1813,1819 ----
  	tzset();
  	/*
  	** For a positive leap second hit, the result
! 	** is not unique. For a negative leap second
  	** hit, the corresponding time doesn't exist,
  	** so we return an adjacent second.
  	*/
diff -r -c old/newstrftime.3 new/newstrftime.3
*** old/newstrftime.3	Mon Jan 31 09:20:46 2005
--- new/newstrftime.3	Mon Jan 31 14:06:49 2005
***************
*** 151,163 ****
  is replaced by a newline.
  .TP
  %p
! is replaced by the locale's equivalent of either AM or PM. 
  .TP
  %R
  is replaced by the time in the format %H:%M.
  .TP
  %r
! is replaced by the locale's representation of 12-hour clock time 
  using AM/PM notation.
  .TP
  %S
--- 151,163 ----
  is replaced by a newline.
  .TP
  %p
! is replaced by the locale's equivalent of either AM or PM.
  .TP
  %R
  is replaced by the time in the format %H:%M.
  .TP
  %r
! is replaced by the locale's representation of 12-hour clock time
  using AM/PM notation.
  .TP
  %S
***************
*** 227,230 ****
  newtzset(3),
  time(2),
  tzfile(5)
! .\" @(#)newstrftime.3	7.14
--- 227,230 ----
  newtzset(3),
  time(2),
  tzfile(5)
! .\" @(#)newstrftime.3	7.15
diff -r -c old/northamerica new/northamerica
*** old/northamerica	Mon Jan 17 18:36:17 2005
--- new/northamerica	Mon Jan 31 14:06:50 2005
***************
*** 1,4 ****
! # @(#)northamerica	7.71
  # also includes Central America and the Caribbean
  
  # This data is by no means authoritative; if you think you know better,
--- 1,4 ----
! # @(#)northamerica	7.72
  # also includes Central America and the Caribbean
  
  # This data is by no means authoritative; if you think you know better,
***************
*** 445,451 ****
  # Lemhi, Lincoln, Madison, Minidoka, Oneida, Owyhee, Payette, Power,
  # Teton, Twin Falls, Valley, Washington counties) and eastern Oregon
  # switched four weeks late in 1974.
! # 
  # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
  Zone America/Boise	-7:44:49 -	LMT	1883 Nov 18 12:00
  			-8:00	US	P%sT	1923 May 13 2:00
--- 445,451 ----
  # Lemhi, Lincoln, Madison, Minidoka, Oneida, Owyhee, Payette, Power,
  # Teton, Twin Falls, Valley, Washington counties) and eastern Oregon
  # switched four weeks late in 1974.
! #
  # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
  Zone America/Boise	-7:44:49 -	LMT	1883 Nov 18 12:00
  			-8:00	US	P%sT	1923 May 13 2:00
diff -r -c old/private.h new/private.h
*** old/private.h	Mon Jan 31 09:19:08 2005
--- new/private.h	Mon Jan 31 14:06:49 2005
***************
*** 91,103 ****
  #include "time.h"
  #include "stdlib.h"
  
! #if HAVE_GETTEXT - 0
  #include "libintl.h"
! #endif /* HAVE_GETTEXT - 0 */
  
! #if HAVE_SYS_WAIT_H - 0
  #include <sys/wait.h>	/* for WIFEXITED and WEXITSTATUS */
! #endif /* HAVE_SYS_WAIT_H - 0 */
  
  #ifndef WIFEXITED
  #define WIFEXITED(status)	(((status) & 0xff) == 0)
--- 91,103 ----
  #include "time.h"
  #include "stdlib.h"
  
! #if HAVE_GETTEXT
  #include "libintl.h"
! #endif /* HAVE_GETTEXT */
  
! #if HAVE_SYS_WAIT_H
  #include <sys/wait.h>	/* for WIFEXITED and WEXITSTATUS */
! #endif /* HAVE_SYS_WAIT_H */
  
  #ifndef WIFEXITED
  #define WIFEXITED(status)	(((status) & 0xff) == 0)
***************
*** 106,116 ****
  #define WEXITSTATUS(status)	(((status) >> 8) & 0xff)
  #endif /* !defined WEXITSTATUS */
  
! #if HAVE_UNISTD_H - 0
  #include "unistd.h"	/* for F_OK and R_OK */
! #endif /* HAVE_UNISTD_H - 0 */
  
! #if !(HAVE_UNISTD_H - 0)
  #ifndef F_OK
  #define F_OK	0
  #endif /* !defined F_OK */
--- 106,116 ----
  #define WEXITSTATUS(status)	(((status) >> 8) & 0xff)
  #endif /* !defined WEXITSTATUS */
  
! #if HAVE_UNISTD_H
  #include "unistd.h"	/* for F_OK and R_OK */
! #endif /* HAVE_UNISTD_H */
  
! #if !HAVE_UNISTD_H
  #ifndef F_OK
  #define F_OK	0
  #endif /* !defined F_OK */
***************
*** 117,125 ****
  #ifndef R_OK
  #define R_OK	4
  #endif /* !defined R_OK */
! #endif /* !(HAVE_UNISTD_H - 0) */
  
! /* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX.
*/
  #define is_digit(c) ((unsigned)(c) - '0' <= 9)
  
  /*
--- 117,125 ----
  #ifndef R_OK
  #define R_OK	4
  #endif /* !defined R_OK */
! #endif /* !HAVE_UNISTD_H */
  
! /* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX.
*/
  #define is_digit(c) ((unsigned)(c) - '0' <= 9)
  
  /*
***************
*** 216,222 ****
  void *	irealloc P((void * pointer, int size));
  void	icfree P((char * pointer));
  void	ifree P((char * pointer));
! char *	scheck P((const char *string, const char *format));
  
  /*
  ** Finally, some convenience items.
--- 216,222 ----
  void *	irealloc P((void * pointer, int size));
  void	icfree P((char * pointer));
  void	ifree P((char * pointer));
! char *	scheck P((const char *string, char *format));
  
  /*
  ** Finally, some convenience items.
***************
*** 255,261 ****
  ** add one more for a minus sign if the type is signed.
  */
  #define INT_STRLEN_MAXIMUM(type) \
!     ((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 1000 + 1 +
TYPE_SIGNED(type))
  #endif /* !defined INT_STRLEN_MAXIMUM */
  
  /*
--- 255,262 ----
  ** add one more for a minus sign if the type is signed.
  */
  #define INT_STRLEN_MAXIMUM(type) \
! 	((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 1000 + \
! 	1 + TYPE_SIGNED(type))
  #endif /* !defined INT_STRLEN_MAXIMUM */
  
  /*
***************
*** 289,299 ****
  */
  
  #ifndef _
! #if HAVE_GETTEXT - 0
  #define _(msgid) gettext(msgid)
! #else /* !(HAVE_GETTEXT - 0) */
  #define _(msgid) msgid
! #endif /* !(HAVE_GETTEXT - 0) */
  #endif /* !defined _ */
  
  #ifndef TZ_DOMAIN
--- 290,300 ----
  */
  
  #ifndef _
! #if HAVE_GETTEXT
  #define _(msgid) gettext(msgid)
! #else /* !HAVE_GETTEXT */
  #define _(msgid) msgid
! #endif /* !HAVE_GETTEXT */
  #endif /* !defined _ */
  
  #ifndef TZ_DOMAIN
diff -r -c old/scheck.c new/scheck.c
*** old/scheck.c	Mon Jan 31 09:20:47 2005
--- new/scheck.c	Mon Jan 31 14:06:49 2005
***************
*** 1,6 ****
  #ifndef lint
  #ifndef NOID
! static char	elsieid[] = "@(#)scheck.c	8.15";
  #endif /* !defined lint */
  #endif /* !defined NOID */
  
--- 1,6 ----
  #ifndef lint
  #ifndef NOID
! static char	elsieid[] = "@(#)scheck.c	8.16";
  #endif /* !defined lint */
  #endif /* !defined NOID */
  
***************
*** 11,17 ****
  char *
  scheck(string, format)
  const char * const	string;
! const char * const	format;
  {
  	register char *		fbuf;
  	register const char *	fp;
--- 11,17 ----
  char *
  scheck(string, format)
  const char * const	string;
! char * const		format;
  {
  	register char *		fbuf;
  	register const char *	fp;
diff -r -c old/southamerica new/southamerica
*** old/southamerica	Mon Jan 17 18:36:17 2005
--- new/southamerica	Mon Jan 31 14:06:50 2005
***************
*** 1,4 ****
! # @(#)southamerica	7.57
  
  # This data is by no means authoritative; if you think you know better,
  # go ahead and edit the file (and please send any changes to
--- 1,4 ----
! # @(#)southamerica	7.58
  
  # This data is by no means authoritative; if you think you know better,
  # go ahead and edit the file (and please send any changes to
***************
*** 964,970 ****
  #
  # <a href="news:xrGmb.39935$gA1.13896113 at news4.srv.hcvlny.cv.net">
  # From Evelyn C. Leeper via Mark Brader (2003-10-26):</a>
! # When we were in Peru in 1985-1986, they apparently switched over 
  # sometime between December 29 and January 3 while we were on the Amazon.
  #
  # From Paul Eggert (2003-11-02):
--- 964,970 ----
  #
  # <a href="news:xrGmb.39935$gA1.13896113 at news4.srv.hcvlny.cv.net">
  # From Evelyn C. Leeper via Mark Brader (2003-10-26):</a>
! # When we were in Peru in 1985-1986, they apparently switched over
  # sometime between December 29 and January 3 while we were on the Amazon.
  #
  # From Paul Eggert (2003-11-02):
diff -r -c old/strftime.c new/strftime.c
*** old/strftime.c	Mon Jan 31 09:20:47 2005
--- new/strftime.c	Mon Jan 31 14:06:50 2005
***************
*** 1,6 ****
  #ifndef lint
  #ifndef NOID
! static char	elsieid[] = "@(#)strftime.c	7.74";
  /*
  ** Based on the UCB version with the ID appearing below.
  ** This is ANSIish only when "multibyte character == plain character".
--- 1,6 ----
  #ifndef lint
  #ifndef NOID
! static char	elsieid[] = "@(#)strftime.c	7.75";
  /*
  ** Based on the UCB version with the ID appearing below.
  ** This is ANSIish only when "multibyte character == plain character".
***************
*** 19,25 ****
  ** duplicated in all such forms and that any documentation,
  ** advertising materials, and other materials related to such
  ** distribution and use acknowledge that the software was developed
! ** by the University of California, Berkeley.  The name of the
  ** University may not be used to endorse or promote products derived
  ** from this software without specific prior written permission.
  ** THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
--- 19,25 ----
  ** duplicated in all such forms and that any documentation,
  ** advertising materials, and other materials related to such
  ** distribution and use acknowledge that the software was developed
! ** by the University of California, Berkeley. The name of the
  ** University may not be used to endorse or promote products derived
  ** from this software without specific prior written permission.
  ** THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
***************
*** 91,97 ****
  	** C99 requires this format.
  	** Previously this code used "%D %X", but we now conform to C99.
  	** Note that
! 	**      "%a %b %d %H:%M:%S %Y"
  	** is used by Solaris 2.3.
  	*/
  	"%a %b %e %T %Y",
--- 91,97 ----
  	** C99 requires this format.
  	** Previously this code used "%D %X", but we now conform to C99.
  	** Note that
! 	**	"%a %b %d %H:%M:%S %Y"
  	** is used by Solaris 2.3.
  	*/
  	"%a %b %e %T %Y",
***************
*** 108,114 ****
  
  static char *	_add P((const char *, char *, const char *));
  static char *	_conv P((int, const char *, char *, const char *));
! static char *	_fmt P((const char *, const struct tm *, char *, const char
*, int *));
  static char *	_yconv P((int, int, int, int, char *, const char *));
  
  extern char *	tzname[];
--- 108,115 ----
  
  static char *	_add P((const char *, char *, const char *));
  static char *	_conv P((int, const char *, char *, const char *));
! static char *	_fmt P((const char *, const struct tm *, char *, const char
*,
! 			int *));
  static char *	_yconv P((int, int, int, int, char *, const char *));
  
  extern char *	tzname[];
***************
*** 264,270 ****
  				**		t->tm_hour % 12 : 12, 2, '
');
  				** ...and has been changed to the below to
  				** match SunOS 4.1.1 and Arnold Robbins'
! 				** strftime version 3.0.  That is, "%k" and
  				** "%l" have been swapped.
  				** (ado, 1993-05-24)
  				*/
--- 265,271 ----
  				**		t->tm_hour % 12 : 12, 2, '
');
  				** ...and has been changed to the below to
  				** match SunOS 4.1.1 and Arnold Robbins'
! 				** strftime version 3.0. That is, "%k" and
  				** "%l" have been swapped.
  				** (ado, 1993-05-24)
  				*/
***************
*** 284,290 ****
  				**	_conv(t->tm_hour, 2, ' ');
  				** ...and has been changed to the below to
  				** match SunOS 4.1.1 and Arnold Robbin's
! 				** strftime version 3.0.  That is, "%k" and
  				** "%l" have been swapped.
  				** (ado, 1993-05-24)
  				*/
--- 285,291 ----
  				**	_conv(t->tm_hour, 2, ' ');
  				** ...and has been changed to the below to
  				** match SunOS 4.1.1 and Arnold Robbin's
! 				** strftime version 3.0. That is, "%k" and
  				** "%l" have been swapped.
  				** (ado, 1993-05-24)
  				*/
***************
*** 359,365 ****
  			case 'G':	/* ISO 8601 year (four digits) */
  			case 'g':	/* ISO 8601 year (two digits) */
  /*
! ** From Arnold Robbins' strftime version 3.0:  "the week number of the
  ** year (the first Monday as the first day of week 1) as a decimal number
  ** (01-53)."
  ** (ado, 1993-05-24)
--- 360,366 ----
  			case 'G':	/* ISO 8601 year (four digits) */
  			case 'g':	/* ISO 8601 year (two digits) */
  /*
! ** From Arnold Robbins' strftime version 3.0: "the week number of the
  ** year (the first Monday as the first day of week 1) as a decimal number
  ** (01-53)."
  ** (ado, 1993-05-24)
***************
*** 372,378 ****
  ** might also contain days from the previous year and the week before week
  ** 01 of a year is the last week (52 or 53) of the previous year even if
  ** it contains days from the new year. A week starts with Monday (day 1)
! ** and ends with Sunday (day 7).  For example, the first week of the year
  ** 1997 lasts from 1996-12-30 to 1997-01-05..."
  ** (ado, 1996-01-02)
  */
--- 373,379 ----
  ** might also contain days from the previous year and the week before week
  ** 01 of a year is the last week (52 or 53) of the previous year even if
  ** it contains days from the new year. A week starts with Monday (day 1)
! ** and ends with Sunday (day 7). For example, the first week of the year
  ** 1997 lasts from 1996-12-30 to 1997-01-05..."
  ** (ado, 1996-01-02)
  */
***************
*** 512,523 ****
  				/*
  				** C99 says that the UTC offset must
  				** be computed by looking only at
! 				** tm_isdst.  This requirement is
  				** incorrect, since it means the code
  				** must rely on magic (in this case
  				** altzone and timezone), and the
  				** magic might not have the correct
! 				** offset.  Doing things correctly is
  				** tricky and requires disobeying C99;
  				** see GNU C strftime for details.
  				** For now, punt and conform to the
--- 513,524 ----
  				/*
  				** C99 says that the UTC offset must
  				** be computed by looking only at
! 				** tm_isdst. This requirement is
  				** incorrect, since it means the code
  				** must rely on magic (in this case
  				** altzone and timezone), and the
  				** magic might not have the correct
! 				** offset. Doing things correctly is
  				** tricky and requires disobeying C99;
  				** see GNU C strftime for details.
  				** For now, punt and conform to the
***************
*** 559,565 ****
  			case '%':
  			/*
  			** X311J/88-090 (4.12.3.5): if conversion char is
! 			** undefined, behavior is undefined.  Print out the
  			** character itself as printf(3) also does.
  			*/
  			default:
--- 560,566 ----
  			case '%':
  			/*
  			** X311J/88-090 (4.12.3.5): if conversion char is
! 			** undefined, behavior is undefined. Print out the
  			** character itself as printf(3) also does.
  			*/
  			default:
***************
*** 682,688 ****
  	** Slurp the locale file into the cache.
  	*/
  	namesize = strlen(name) + 1;
! 	if (sizeof filename  <
  		((sizeof locale_home) + namesize + (sizeof lc_time)))
  			goto no_locale;
  	oldsun = 0;
--- 683,689 ----
  	** Slurp the locale file into the cache.
  	*/
  	namesize = strlen(name) + 1;
! 	if (sizeof filename <
  		((sizeof locale_home) + namesize + (sizeof lc_time)))
  			goto no_locale;
  	oldsun = 0;
***************
*** 705,711 ****
  		goto bad_locale;
  	bufsize = namesize + st.st_size;
  	locale_buf = NULL;
! 	lbuf = (lbuf == NULL) ?  malloc(bufsize) : realloc(lbuf, bufsize);
  	if (lbuf == NULL)
  		goto bad_locale;
  	(void) strcpy(lbuf, name);
--- 706,712 ----
  		goto bad_locale;
  	bufsize = namesize + st.st_size;
  	locale_buf = NULL;
! 	lbuf = (lbuf == NULL) ? malloc(bufsize) : realloc(lbuf, bufsize);
  	if (lbuf == NULL)
  		goto bad_locale;
  	(void) strcpy(lbuf, name);
diff -r -c old/tz-art.htm new/tz-art.htm
*** old/tz-art.htm	Mon Jan 31 09:20:48 2005
--- new/tz-art.htm	Mon Jan 31 14:06:50 2005
***************
*** 1,5 ****
  <?xml version="1.0" encoding="US-ASCII"?>
! <!DOCTYPE html 
  PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "DTD/xhtml1-strict.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
--- 1,5 ----
  <?xml version="1.0" encoding="US-ASCII"?>
! <!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "DTD/xhtml1-strict.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
***************
*** 10,16 ****
  <body>
  <h1>Time and the Arts</h1>
  <address>
! @(#)tz-art.htm	7.53
  </address>
  <p>
  Please send corrections to this web page to the
--- 10,16 ----
  <body>
  <h1>Time and the Arts</h1>
  <address>
! @(#)tz-art.htm	7.54
  </address>
  <p>
  Please send corrections to this web page to the
diff -r -c old/tzfile.h new/tzfile.h
*** old/tzfile.h	Mon Jan 31 09:19:08 2005
--- new/tzfile.h	Mon Jan 31 14:06:49 2005
***************
*** 21,27 ****
  
  #ifndef lint
  #ifndef NOID
! static char	tzfilehid[] = "@(#)tzfile.h	7.16";
  #endif /* !defined NOID */
  #endif /* !defined lint */
  
--- 21,27 ----
  
  #ifndef lint
  #ifndef NOID
! static char	tzfilehid[] = "@(#)tzfile.h	7.17";
  #endif /* !defined NOID */
  #endif /* !defined lint */
  
***************
*** 48,54 ****
  #define	TZ_MAGIC	"TZif"
  
  struct tzhead {
!  	char	tzh_magic[4];		/* TZ_MAGIC */
  	char	tzh_reserved[16];	/* reserved for future use */
  	char	tzh_ttisgmtcnt[4];	/* coded number of trans. time flags
*/
  	char	tzh_ttisstdcnt[4];	/* coded number of trans. time flags
*/
--- 48,54 ----
  #define	TZ_MAGIC	"TZif"
  
  struct tzhead {
! 	char	tzh_magic[4];		/* TZ_MAGIC */
  	char	tzh_reserved[16];	/* reserved for future use */
  	char	tzh_ttisgmtcnt[4];	/* coded number of trans. time flags
*/
  	char	tzh_ttisstdcnt[4];	/* coded number of trans. time flags
*/
***************
*** 172,197 ****
  
  #define isleap_sum(a, b)	isleap((a) % 400 + (b) % 400)
  
- #ifndef USG
- 
- /*
- ** Use of the underscored variants may cause problems if you move your
code to
- ** certain System-V-based systems; for maximum portability, use the
- ** underscore-free variants.  The underscored variants are provided for
- ** backward compatibility only; they may disappear from future versions of
- ** this file.
- */
- 
- #define SECS_PER_MIN	SECSPERMIN
- #define MINS_PER_HOUR	MINSPERHOUR
- #define HOURS_PER_DAY	HOURSPERDAY
- #define DAYS_PER_WEEK	DAYSPERWEEK
- #define DAYS_PER_NYEAR	DAYSPERNYEAR
- #define DAYS_PER_LYEAR	DAYSPERLYEAR
- #define SECS_PER_HOUR	SECSPERHOUR
- #define SECS_PER_DAY	SECSPERDAY
- #define MONS_PER_YEAR	MONSPERYEAR
- 
- #endif /* !defined USG */
- 
  #endif /* !defined TZFILE_H */
--- 172,175 ----
diff -r -c old/workman.sh new/workman.sh
*** old/workman.sh	Mon Jan 31 09:20:49 2005
--- new/workman.sh	Mon Jan 31 14:06:50 2005
***************
*** 1,6 ****
  #! /bin/sh
  
! # @(#)workman.sh	1.7
  
  # Tell groff not to emit SGR escape sequences (ANSI color escapes).
  GROFF_NO_SGR=1
--- 1,6 ----
  #! /bin/sh
  
! # @(#)workman.sh	1.8
  
  # Tell groff not to emit SGR escape sequences (ANSI color escapes).
  GROFF_NO_SGR=1
***************
*** 26,29 ****
  		print "$_\n";
  		$didprint = 1;
  	}
! ' 
--- 26,29 ----
  		print "$_\n";
  		$didprint = 1;
  	}
! '
diff -r -c old/yearistype.sh new/yearistype.sh
*** old/yearistype.sh	Mon Jan 17 18:36:18 2005
--- new/yearistype.sh	Mon Jan 31 14:06:50 2005
***************
*** 1,6 ****
  #! /bin/sh
  
! : '@(#)yearistype.sh	7.7'
  
  case $#-$1 in
  	2-|2-0*|2-*[!0-9]*)
--- 1,6 ----
  #! /bin/sh
  
! : '@(#)yearistype.sh	7.8'
  
  case $#-$1 in
  	2-|2-0*|2-*[!0-9]*)
***************
*** 9,15 ****
  esac
  
  case $#-$2 in
! 	2-even)	
  		case $1 in
  			*[24680])			exit 0 ;;
  			*)				exit 1 ;;
--- 9,15 ----
  esac
  
  case $#-$2 in
! 	2-even)
  		case $1 in
  			*[24680])			exit 0 ;;
  			*)				exit 1 ;;
***************
*** 19,25 ****
  			*[02468][048]|*[13579][26])	exit 1 ;;
  			*)				exit 0 ;;
  		esac ;;
! 	2-odd)	
  		case $1 in
  			*[13579])			exit 0 ;;
  			*)				exit 1 ;;
--- 19,25 ----
  			*[02468][048]|*[13579][26])	exit 1 ;;
  			*)				exit 0 ;;
  		esac ;;
! 	2-odd)
  		case $1 in
  			*[13579])			exit 0 ;;
  			*)				exit 1 ;;
***************
*** 29,35 ****
  			*[02468][048]|*[13579][26])	exit 0 ;;
  			*)				exit 1 ;;
  		esac ;;
! 	2-*)	
  		echo "$0: wild type - $2" >&2 ;;
  esac
  
--- 29,35 ----
  			*[02468][048]|*[13579][26])	exit 0 ;;
  			*)				exit 1 ;;
  		esac ;;
! 	2-*)
  		echo "$0: wild type - $2" >&2 ;;
  esac
  
diff -r -c old/zdump.c new/zdump.c
*** old/zdump.c	Mon Jan 31 09:20:47 2005
--- new/zdump.c	Mon Jan 31 14:20:42 2005
***************
*** 1,4 ****
! static char	elsieid[] = "@(#)zdump.c	7.61";
  
  /*
  ** This code has been made independent of the rest of the time
--- 1,4 ----
! static char	elsieid[] = "@(#)zdump.c	7.63";
  
  /*
  ** This code has been made independent of the rest of the time
***************
*** 215,221 ****
  	INITIALIZE(cutlotime);
  	INITIALIZE(cuthitime);
  #if HAVE_GETTEXT
! 	(void) setlocale(LC_MESSAGES, "");
  #ifdef TZ_DOMAINDIR
  	(void) bindtextdomain(TZ_DOMAIN, TZ_DOMAINDIR);
  #endif /* defined TEXTDOMAINDIR */
--- 215,221 ----
  	INITIALIZE(cutlotime);
  	INITIALIZE(cuthitime);
  #if HAVE_GETTEXT
! 	(void) setlocale(LC_ALL, "");
  #ifdef TZ_DOMAINDIR
  	(void) bindtextdomain(TZ_DOMAIN, TZ_DOMAINDIR);
  #endif /* defined TEXTDOMAINDIR */
***************
*** 318,324 ****
  			newtmp = localtime(&newt);
  			if (newtmp != NULL)
  				newtm = *newtmp;
! 			if ((tmp == NULL || newtmp == NULL) ?  (tmp !=
newtmp) :
  				(delta(&newtm, &tm) != (newt - t) ||
  				newtm.tm_isdst != tm.tm_isdst ||
  				strcmp(abbr(&newtm), buf) != 0)) {
--- 318,324 ----
  			newtmp = localtime(&newt);
  			if (newtmp != NULL)
  				newtm = *newtmp;
! 			if ((tmp == NULL || newtmp == NULL) ? (tmp !=
newtmp) :
  				(delta(&newtm, &tm) != (newt - t) ||
  				newtm.tm_isdst != tm.tm_isdst ||
  				strcmp(abbr(&newtm), buf) != 0)) {
diff -r -c old/zic.c new/zic.c
*** old/zic.c	Mon Jan 31 09:20:47 2005
--- new/zic.c	Mon Jan 31 14:20:42 2005
***************
*** 1,4 ****
! static char	elsieid[] = "@(#)zic.c	7.120";
  
  /*
  ** Regardless of the type of time_t, we do our work using this type.
--- 1,4 ----
! static char	elsieid[] = "@(#)zic.c	7.122";
  
  /*
  ** Regardless of the type of time_t, we do our work using this type.
***************
*** 21,27 ****
  
  /*
  ** On some ancient hosts, predicates like `isspace(C)' are defined
! ** only if isascii(C) || C == EOF.  Modern hosts obey the C Standard,
  ** which says they are defined only if C == ((unsigned char) C) || C ==
EOF.
  ** Neither the C Standard nor Posix require that `isascii' exist.
  ** For portability, we check both ancient and modern requirements.
--- 21,27 ----
  
  /*
  ** On some ancient hosts, predicates like `isspace(C)' are defined
! ** only if isascii(C) || C == EOF. Modern hosts obey the C Standard,
  ** which says they are defined only if C == ((unsigned char) C) || C ==
EOF.
  ** Neither the C Standard nor Posix require that `isascii' exist.
  ** For portability, we check both ancient and modern requirements.
***************
*** 138,146 ****
  static void	writezone P((const char * name));
  static int	yearistype P((int year, const char * type));
  
! #if !(HAVE_STRERROR - 0)
  static char *	strerror P((int));
! #endif /* !(HAVE_STRERROR - 0) */
  
  static int		charcnt;
  static int		errors;
--- 138,146 ----
  static void	writezone P((const char * name));
  static int	yearistype P((int year, const char * type));
  
! #if !HAVE_STRERROR
  static char *	strerror P((int));
! #endif /* !HAVE_STRERROR */
  
  static int		charcnt;
  static int		errors;
***************
*** 380,386 ****
  ** Error handling.
  */
  
! #if !(HAVE_STRERROR - 0)
  static char *
  strerror(errnum)
  int	errnum;
--- 380,386 ----
  ** Error handling.
  */
  
! #if !HAVE_STRERROR
  static char *
  strerror(errnum)
  int	errnum;
***************
*** 391,397 ****
  	return (errnum > 0 && errnum <= sys_nerr) ?
  		sys_errlist[errnum] : _("Unknown system error");
  }
! #endif /* !(HAVE_STRERROR - 0) */
  
  static void
  eats(name, num, rname, rnum)
--- 391,397 ----
  	return (errnum > 0 && errnum <= sys_nerr) ?
  		sys_errlist[errnum] : _("Unknown system error");
  }
! #endif /* !HAVE_STRERROR */
  
  static void
  eats(name, num, rname, rnum)
***************
*** 448,454 ****
  static void
  usage P((void))
  {
! 	(void) fprintf(stderr, _("%s: usage is %s [ --version ] [ -s ] [ -v
] [ -l localtime ] [ -p posixrules ] \\\n\t[ -d directory ] [ -L leapseconds
] [ -y yearistype ] [ filename ... ]\n"),
  		progname, progname);
  	(void) exit(EXIT_FAILURE);
  }
--- 448,456 ----
  static void
  usage P((void))
  {
! 	(void) fprintf(stderr, _("%s: usage is %s \
! [ --version ] [ -s ] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n\
! \t[ -d directory ] [ -L leapseconds ] [ -y yearistype ] [ filename ...
]\n"),
  		progname, progname);
  	(void) exit(EXIT_FAILURE);
  }
***************
*** 472,484 ****
  #ifdef unix
  	(void) umask(umask(S_IWGRP | S_IWOTH) | (S_IWGRP | S_IWOTH));
  #endif /* defined unix */
! #if HAVE_GETTEXT - 0
! 	(void) setlocale(LC_MESSAGES, "");
  #ifdef TZ_DOMAINDIR
  	(void) bindtextdomain(TZ_DOMAIN, TZ_DOMAINDIR);
  #endif /* defined TEXTDOMAINDIR */
  	(void) textdomain(TZ_DOMAIN);
! #endif /* HAVE_GETTEXT - 0 */
  	progname = argv[0];
  	for (i = 1; i < argc; ++i)
  		if (strcmp(argv[i], "--version") == 0) {
--- 474,486 ----
  #ifdef unix
  	(void) umask(umask(S_IWGRP | S_IWOTH) | (S_IWGRP | S_IWOTH));
  #endif /* defined unix */
! #if HAVE_GETTEXT
! 	(void) setlocale(LC_ALL, "");
  #ifdef TZ_DOMAINDIR
  	(void) bindtextdomain(TZ_DOMAIN, TZ_DOMAINDIR);
  #endif /* defined TEXTDOMAINDIR */
  	(void) textdomain(TZ_DOMAIN);
! #endif /* HAVE_GETTEXT */
  	progname = argv[0];
  	for (i = 1; i < argc; ++i)
  		if (strcmp(argv[i], "--version") == 0) {
***************
*** 631,652 ****
  			(void) exit(EXIT_FAILURE);
  
  		result = link(fromname, toname);
! #if (HAVE_SYMLINK - 0)
  		if (result != 0 &&
! 		    access(fromname, F_OK) == 0 &&
! 		    !itsdir(fromname)) {
! 		        const char *s = tofile;
! 		        register char * symlinkcontents = NULL;
! 		        while ((s = strchr(s+1, '/')) != NULL)
! 			        symlinkcontents = ecatalloc(symlinkcontents,
"../");
! 			symlinkcontents = ecatalloc(symlinkcontents,
fromfile);
  
! 			result = symlink(symlinkcontents, toname);
! 			if (result == 0)
  warning(_("hard link failed, symbolic link used"));
! 			ifree(symlinkcontents);
  		}
! #endif
  		if (result != 0) {
  			const char *e = strerror(errno);
  
--- 633,659 ----
  			(void) exit(EXIT_FAILURE);
  
  		result = link(fromname, toname);
! #if HAVE_SYMLINK
  		if (result != 0 &&
! 			access(fromname, F_OK) == 0 &&
! 			!itsdir(fromname)) {
! 				const char *s = tofile;
! 				register char * symlinkcontents = NULL;
  
! 				while ((s = strchr(s+1, '/')) != NULL)
! 					symlinkcontents =
! 						ecatalloc(symlinkcontents,
! 						"../");
! 					symlinkcontents =
! 						ecatalloc(symlinkcontents,
! 						fromfile);
! 					result = symlink(symlinkcontents,
! 						toname);
! 					if (result == 0)
  warning(_("hard link failed, symbolic link used"));
! 					ifree(symlinkcontents);
  		}
! #endif /* HAVE_SYMLINK */
  		if (result != 0) {
  			const char *e = strerror(errno);
  
***************
*** 804,810 ****
  			*/
  			eat(zp->z_filename, zp->z_linenum);
  			zp->z_stdoff = gethms(zp->z_rule, _("unruly zone"),
! 					      TRUE);
  			/*
  			** Note, though, that if there's no rule,
  			** a '%s' in the format is a bad thing.
--- 811,817 ----
  			*/
  			eat(zp->z_filename, zp->z_linenum);
  			zp->z_stdoff = gethms(zp->z_rule, _("unruly zone"),
! 				TRUE);
  			/*
  			** Note, though, that if there's no rule,
  			** a '%s' in the format is a bad thing.
***************
*** 1107,1113 ****
  			zones[nzones - 1].z_untiltime > min_time &&
  			zones[nzones - 1].z_untiltime < max_time &&
  			zones[nzones - 1].z_untiltime >= z.z_untiltime) {
! 				error(_("Zone continuation line end time is
not after end time of previous line"));
  				return FALSE;
  		}
  	}
--- 1114,1122 ----
  			zones[nzones - 1].z_untiltime > min_time &&
  			zones[nzones - 1].z_untiltime < max_time &&
  			zones[nzones - 1].z_untiltime >= z.z_untiltime) {
! 				error(_(
! "Zone continuation line end time is not after end time of previous line"
! 					));
  				return FALSE;
  		}
  	}
***************
*** 1140,1150 ****
  	dayoff = 0;
  	cp = fields[LP_YEAR];
  	if (sscanf(cp, scheck(cp, "%d"), &year) != 1) {
! 			/*
! 			 * Leapin' Lizards!
! 			 */
! 			error(_("invalid leaping year"));
! 			return;
  	}
  	j = EPOCH_YEAR;
  	while (j != year) {
--- 1149,1159 ----
  	dayoff = 0;
  	cp = fields[LP_YEAR];
  	if (sscanf(cp, scheck(cp, "%d"), &year) != 1) {
! 		/*
! 		** Leapin' Lizards!
! 		*/
! 		error(_("invalid leaping year"));
! 		return;
  	}
  	j = EPOCH_YEAR;
  	while (j != year) {
***************
*** 1211,1217 ****
  			return;
  		}
  		if ((lp = byword(fields[LP_ROLL], leap_types)) == NULL) {
! 			error(_("illegal Rolling/Stationary field on Leap
line"));
  			return;
  		}
  		leapadd(tadd(t, tod), positive, lp->l_value, count);
--- 1220,1228 ----
  			return;
  		}
  		if ((lp = byword(fields[LP_ROLL], leap_types)) == NULL) {
! 			error(_(
! 				"illegal Rolling/Stationary field on Leap
line"
! 				));
  			return;
  		}
  		leapadd(tadd(t, tod), positive, lp->l_value, count);
***************
*** 1473,1486 ****
  			while (fromi < timecnt && attypes[fromi].type == 0)
  				++fromi;	/* handled by default rule
*/
  		for ( ; fromi < timecnt; ++fromi) {
! 			if (toi != 0
! 			    && ((attypes[fromi].at
! 				 + gmtoffs[attypes[toi - 1].type])
! 				<= (attypes[toi - 1].at
! 				    + gmtoffs[toi == 1 ? 0
! 					      : attypes[toi - 2].type]))) {
! 				attypes[toi - 1].type = attypes[fromi].type;
! 				continue;
  			}
  			if (toi == 0 ||
  				attypes[toi - 1].type !=
attypes[fromi].type)
--- 1484,1496 ----
  			while (fromi < timecnt && attypes[fromi].type == 0)
  				++fromi;	/* handled by default rule
*/
  		for ( ; fromi < timecnt; ++fromi) {
! 			if (toi != 0 && ((attypes[fromi].at +
! 				gmtoffs[attypes[toi - 1].type]) <=
! 				(attypes[toi - 1].at + gmtoffs[toi == 1 ? 0
! 				: attypes[toi - 2].type]))) {
! 					attypes[toi - 1].type =
! 						attypes[fromi].type;
! 					continue;
  			}
  			if (toi == 0 ||
  				attypes[toi - 1].type !=
attypes[fromi].type)
***************
*** 1526,1532 ****
  	convert(eitol(typecnt), tzh.tzh_typecnt);
  	convert(eitol(charcnt), tzh.tzh_charcnt);
  	(void) strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
! #define DO(field)	(void) fwrite((void *) tzh.field, (size_t) sizeof
tzh.field, (size_t) 1, fp)
  	DO(tzh_magic);
  	DO(tzh_reserved);
  	DO(tzh_ttisgmtcnt);
--- 1536,1543 ----
  	convert(eitol(typecnt), tzh.tzh_typecnt);
  	convert(eitol(charcnt), tzh.tzh_charcnt);
  	(void) strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
! #define DO(field)	(void) fwrite((void *) tzh.field, \
! 				(size_t) sizeof tzh.field, (size_t) 1, fp)
  	DO(tzh_magic);
  	DO(tzh_reserved);
  	DO(tzh_ttisgmtcnt);
***************
*** 1745,1756 ****
  						continue;
  					}
  					if (*startbuf == '\0' &&
! 					    startoff == oadd(zp->z_gmtoff,
! 					    stdoff)) {
! 						doabbr(startbuf,
zp->z_format,
! 							rp->r_abbrvar,
! 							rp->r_stdoff != 0);
! 					}
  				}
  				eats(zp->z_filename, zp->z_linenum,
  					rp->r_filename, rp->r_linenum);
--- 1756,1768 ----
  						continue;
  					}
  					if (*startbuf == '\0' &&
! 						startoff ==
oadd(zp->z_gmtoff,
! 						stdoff))
! 							doabbr(startbuf,
!
zp->z_format,
!
rp->r_abbrvar,
! 								rp->r_stdoff
!=
! 								0);
  				}
  				eats(zp->z_filename, zp->z_linenum,
  					rp->r_filename, rp->r_linenum);
***************
*** 2041,2047 ****
  			else while ((*dp = *cp++) != '"')
  				if (*dp != '\0')
  					++dp;
! 				else	error(_("Odd number of quotation
marks"));
  		} while (*cp != '\0' && *cp != '#' &&
  			(!isascii(*cp) || !isspace((unsigned char) *cp)));
  		if (isascii(*cp) && isspace((unsigned char) *cp))
--- 2053,2061 ----
  			else while ((*dp = *cp++) != '"')
  				if (*dp != '\0')
  					++dp;
! 				else	error(_(
! 						"Odd number of quotation
marks"
! 						));
  		} while (*cp != '\0' && *cp != '#' &&
  			(!isascii(*cp) || !isspace((unsigned char) *cp)));
  		if (isascii(*cp) && isspace((unsigned char) *cp))
***************
*** 2162,2168 ****
  			}
  		if (i < 0 || i >= len_months[isleap(y)][m]) {
  			if (noise)
! 				warning(_("rule goes past start/end of
month--will not work with pre-2004 versions of zic"));
  		}
  	}
  	if (dayoff < 0 && !TYPE_SIGNED(zic_t))
--- 2176,2183 ----
  			}
  		if (i < 0 || i >= len_months[isleap(y)][m]) {
  			if (noise)
! 				warning(_("rule goes past start/end of
month--\
! will not work with pre-2004 versions of zic"));
  		}
  	}
  	if (dayoff < 0 && !TYPE_SIGNED(zic_t))



More information about the tz mailing list