svn commit: r187665 - in user/edwin/tzcode/tzcode2008e/head:
lib/libc/stdtime usr.sbin/zic
Edwin Groothuis
edwin at FreeBSD.org
Sat Jan 24 02:53:46 PST 2009
Author: edwin
Date: Sat Jan 24 10:53:45 2009
New Revision: 187665
URL: http://svn.freebsd.org/changeset/base/187665
Log:
Import changes of tzcode2009a.
Modified:
user/edwin/tzcode/tzcode2008e/head/lib/libc/stdtime/strftime.c
user/edwin/tzcode/tzcode2008e/head/usr.sbin/zic/zdump.c
user/edwin/tzcode/tzcode2008e/head/usr.sbin/zic/zic.c
Modified: user/edwin/tzcode/tzcode2008e/head/lib/libc/stdtime/strftime.c
==============================================================================
--- user/edwin/tzcode/tzcode2008e/head/lib/libc/stdtime/strftime.c Sat Jan 24 10:22:49 2009 (r187664)
+++ user/edwin/tzcode/tzcode2008e/head/lib/libc/stdtime/strftime.c Sat Jan 24 10:53:45 2009 (r187665)
@@ -17,7 +17,7 @@
#ifndef lint
#ifndef NOID
-static const char elsieid[] = "@(#)strftime.c 8.2";
+static const char elsieid[] = "@(#)strftime.c 8.3";
/*
** Based on the UCB version with the ID appearing below.
** This is ANSIish only when "multibyte character == plain character".
@@ -175,7 +175,7 @@ label:
{
int warn2 = IN_SOME;
- pt = _fmt(tptr->c_fmt, t, pt, ptlim, warnp);
+ pt = _fmt(tptr->c_fmt, t, pt, ptlim, &warn2);
if (warn2 == IN_ALL)
warn2 = IN_THIS;
if (warn2 > *warnp)
Modified: user/edwin/tzcode/tzcode2008e/head/usr.sbin/zic/zdump.c
==============================================================================
--- user/edwin/tzcode/tzcode2008e/head/usr.sbin/zic/zdump.c Sat Jan 24 10:22:49 2009 (r187664)
+++ user/edwin/tzcode/tzcode2008e/head/usr.sbin/zic/zdump.c Sat Jan 24 10:53:45 2009 (r187665)
@@ -2,7 +2,7 @@
#ifndef lint
static const char rcsid[] =
"$FreeBSD$";
-static const char elsieid[] = "@(#)zdump.c 8.6";
+static const char elsieid[] = "@(#)zdump.c 8.8";
#endif /* not lint */
/*
@@ -148,7 +148,7 @@ static size_t longest;
static char * progname;
static int warned;
-static void usage(void);
+static void usage(const char *progname, FILE *stream, int status);
static char * abbr(struct tm * tmp);
static void abbrok(const char * abbrp, const char * zone);
static long delta(struct tm * newp, struct tm * oldp);
@@ -233,6 +233,17 @@ const char * const zone;
progname, zone, abbrp, wp);
warned = TRUE;
}
+
+static void
+usage(const char *progname, FILE *stream, int status)
+{
+ (void) fprintf(stream,
+_("%s: usage is %s [ --version ] [ --help ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n\
+\n\
+Report bugs to tz at elsie.nci.nih.gov.\n"),
+ progname, progname);
+ exit(status);
+}
int
main(argc, argv)
@@ -268,6 +279,8 @@ char * argv[];
for (i = 1; i < argc; ++i)
if (strcmp(argv[i], "--version") == 0) {
errx(EXIT_SUCCESS, "%s", elsieid);
+ } else if (strcmp(argv[i], "--help") == 0) {
+ usage(progname, stdout, EXIT_SUCCESS);
}
vflag = 0;
cutarg = NULL;
@@ -277,7 +290,7 @@ char * argv[];
else cutarg = optarg;
if ((c != -1) ||
(optind == argc - 1 && strcmp(argv[optind], "=") == 0)) {
- usage();
+ usage(progname, stdout, EXIT_FAILURE);
}
if (vflag) {
if (cutarg != NULL) {
@@ -348,13 +361,9 @@ char * argv[];
(void) strncpy(buf, abbr(&tm), (sizeof buf) - 1);
}
for ( ; ; ) {
- if (t >= cuthitime)
+ if (t >= cuthitime || t >= cuthitime - SECSPERHOUR * 12)
break;
newt = t + SECSPERHOUR * 12;
- if (newt >= cuthitime)
- break;
- if (newt <= t)
- break;
newtmp = localtime(&newt);
if (newtmp != NULL)
newtm = *newtmp;
@@ -465,14 +474,6 @@ const long y;
return t;
}
-static void
-usage(void)
-{
- fprintf(stderr,
-_("usage: zdump [--version] [-v] [-c [loyear,]hiyear] zonename ...\n"));
- exit(EXIT_FAILURE);
-}
-
static time_t
hunt(char *name, time_t lot, time_t hit)
{
Modified: user/edwin/tzcode/tzcode2008e/head/usr.sbin/zic/zic.c
==============================================================================
--- user/edwin/tzcode/tzcode2008e/head/usr.sbin/zic/zic.c Sat Jan 24 10:22:49 2009 (r187664)
+++ user/edwin/tzcode/tzcode2008e/head/usr.sbin/zic/zic.c Sat Jan 24 10:53:45 2009 (r187665)
@@ -3,7 +3,7 @@
** 2006-07-17 by Arthur David Olson.
*/
-static const char elsieid[] = "@(#)zic.c 8.17";
+static const char elsieid[] = "@(#)zic.c 8.18";
#ifndef lint
static const char rcsid[] =
@@ -154,7 +154,7 @@ static void setboundaries(void);
static void setgroup(gid_t *flag, const char *name);
static void setuser(uid_t *flag, const char *name);
static zic_t tadd(zic_t t1, long t2);
-static void usage(void);
+static void usage(FILE *stream, int status);
static void writezone(const char * name, const char * string);
static int yearistype(int year, const char * type);
@@ -447,12 +447,15 @@ const char * const string;
}
static void
-usage(void)
+usage(FILE *stream, int status)
{
- (void) fprintf(stderr, _("usage is zic \
-[ --version ] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n\
-\t[ -d directory ] [ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n"));
- exit(EXIT_FAILURE);
+ (void) fprintf(stream, _("usage is %s \
+[ --version ] [--help] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n\
+\t[ -d directory ] [ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n\
+\n\
+Report bugs to tz at elsie.nci.nih.gov.\n"),
+ progname);
+ exit(status);
}
static const char * psxrules;
@@ -493,6 +496,8 @@ char * argv[];
for (i = 1; i < argc; ++i)
if (strcmp(argv[i], "--version") == 0) {
errx(EXIT_SUCCESS, "%s", elsieid);
+ } else if (strcmp(argv[i], "--help") == 0) {
+ usage(stderr, EXIT_FAILURE);
}
while ((c = getopt(argc, argv, "Dd:g:l:m:p:L:u:vsy:")) != -1)
switch (c) {
@@ -560,7 +565,7 @@ _("more than one -L option specified"));
break;
}
if (optind == argc - 1 && strcmp(argv[optind], "=") == 0)
- usage(); /* usage message by request */
+ usage(stderr, EXIT_FAILURE); /* usage message by request */
if (directory == NULL)
directory = TZDIR;
if (yitcommand == NULL)
More information about the svn-src-user
mailing list