diff options
author | 1997-08-21 05:46:55 +0000 | |
---|---|---|
committer | 1997-08-21 05:46:55 +0000 | |
commit | c708f7c44759d1be9981c709e4160821c9febf2a (patch) | |
tree | e4cf6f59050299779d7bdb831cb20e6f3f867b32 | |
parent | constrain nfiles so that fdavail() never lies; bug report and test program from abelits@phobos.illtel.denver.co.us (diff) | |
download | wireguard-openbsd-c708f7c44759d1be9981c709e4160821c9febf2a.tar.xz wireguard-openbsd-c708f7c44759d1be9981c709e4160821c9febf2a.zip |
correct [yy]yy stuff in manpages and usage
-rw-r--r-- | bin/date/date.c | 6 | ||||
-rw-r--r-- | usr.bin/last/last.1 | 4 | ||||
-rw-r--r-- | usr.bin/last/last.c | 154 |
3 files changed, 82 insertions, 82 deletions
diff --git a/bin/date/date.c b/bin/date/date.c index eef362dcbd8..8a855d444ad 100644 --- a/bin/date/date.c +++ b/bin/date/date.c @@ -1,4 +1,4 @@ -/* $OpenBSD: date.c,v 1.7 1997/07/23 14:39:13 kstailey Exp $ */ +/* $OpenBSD: date.c,v 1.8 1997/08/21 05:46:55 deraadt Exp $ */ /* $NetBSD: date.c,v 1.11 1995/09/07 06:21:05 jtc Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)date.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: date.c,v 1.7 1997/07/23 14:39:13 kstailey Exp $"; +static char rcsid[] = "$OpenBSD: date.c,v 1.8 1997/08/21 05:46:55 deraadt Exp $"; #endif #endif /* not lint */ @@ -251,6 +251,6 @@ usage() { (void)fprintf(stderr, "usage: date [-nu] [-d dst] [-r seconds] [-t west] [+format]\n"); - (void)fprintf(stderr, " [yy[mm[dd[hh]]]]mm[.ss]]\n"); + (void)fprintf(stderr, " [[[yy]yy[mm[dd[hh]]]]mm[.ss]]\n"); exit(1); } diff --git a/usr.bin/last/last.1 b/usr.bin/last/last.1 index 067a9ae9919..ca57c409c5e 100644 --- a/usr.bin/last/last.1 +++ b/usr.bin/last/last.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: last.1,v 1.4 1997/07/25 02:23:34 mickey Exp $ +.\" $OpenBSD: last.1,v 1.5 1997/08/21 05:46:56 deraadt Exp $ .\" $NetBSD: last.1,v 1.3 1994/12/21 22:41:23 jtc Exp $ .\" .\" Copyright (c) 1980, 1990, 1993 @@ -47,7 +47,7 @@ .Op Fl f Ar file .Op Fl h Ar host .Op Fl t Ar tty -.Op Fl d Ar [[CC]YY][MMDD]hhmm[.SS] +.Op Fl d Ar [[yy]yy[mm[dd[hh]]]]mm[.ss] .Op user ... .Sh DESCRIPTION .Nm Last diff --git a/usr.bin/last/last.c b/usr.bin/last/last.c index 78aeea25cc0..8ef537c5f2f 100644 --- a/usr.bin/last/last.c +++ b/usr.bin/last/last.c @@ -1,4 +1,4 @@ -/* $OpenBSD: last.c,v 1.6 1997/07/25 02:23:34 mickey Exp $ */ +/* $OpenBSD: last.c,v 1.7 1997/08/21 05:46:56 deraadt Exp $ */ /* $NetBSD: last.c,v 1.6 1994/12/24 16:49:02 cgd Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)last.c 8.2 (Berkeley) 4/2/94"; #endif -static char rcsid[] = "$OpenBSD: last.c,v 1.6 1997/07/25 02:23:34 mickey Exp $"; +static char rcsid[] = "$OpenBSD: last.c,v 1.7 1997/08/21 05:46:56 deraadt Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -89,9 +89,9 @@ static time_t currentout; /* current logout value */ static long maxrec; /* records to display */ static char *file = _PATH_WTMP; /* wtmp file */ static int fulltime = 0; /* Display seconds? */ -static time_t snaptime; /* if != 0, we will only - * report users logged in - * at this snapshot time +static time_t snaptime; /* if != 0, we will only + * report users logged in + * at this snapshot time */ void addarg __P((int, char *)); @@ -153,9 +153,9 @@ main(argc, argv) case '?': default: (void)fprintf(stderr, - "usage: last [-#] [-f file] [-T] [-t tty]" - " [-h host] [-d [MMDD]hhmm[.SS]]" - " [user ...]\n"); + "usage: last [-#] [-f file] [-T] [-t tty]" + " [-h host] [-d [[yy]yy[mm[dd[hh]]]]mm[.ss]]" + " [user ...]\n"); exit(1); } @@ -197,19 +197,19 @@ checkargs() for (step = arglist; step; step = step->next) switch (step->type) { case HOST_TYPE: - (void)fprintf(stderr, "Warning: Ignoring hostname " - "flag\n"); + (void)fprintf(stderr, + "Warning: Ignoring hostname flag\n"); break; case TTY_TYPE: if (!ttyflag) { /* don't print this twice */ - (void)fprintf(stderr, "Warning: Ignoring " - "tty flag\n"); + (void)fprintf(stderr, + "Warning: Ignoring tty flag\n"); ttyflag = 1; } break; case USER_TYPE: - (void)fprintf(stderr, "Warning: Ignoring " - "username[s]\n"); + (void)fprintf(stderr, + "Warning: Ignoring username[s]\n"); break; default: /* PRINT NOTHING */ @@ -507,74 +507,74 @@ ttyconv(arg) /* * dateconv -- * Convert the snapshot time in command line given in the format - * [[CC]YY][MMDD]hhmm[.SS]] to a time_t. + * [[yy]yy][mmdd]hhmm[.ss]] to a time_t. * Derived from atime_arg1() in usr.bin/touch/touch.c */ time_t dateconv(arg) - char *arg; + char *arg; { - time_t timet; - struct tm *t; - int yearset; - char *p; - - /* Start with the current time. */ - if (time(&timet) < 0) - err(1, "time"); - if ((t = localtime(&timet)) == NULL) - err(1, "localtime"); - - /* [[CC]YY][MMDD]hhmm[.SS] */ - if ((p = strchr(arg, '.')) == NULL) - t->tm_sec = 0; /* Seconds defaults to 0. */ - else { - if (strlen(p + 1) != 2) - goto terr; - *p++ = '\0'; - t->tm_sec = ATOI2(p); - } - - yearset = 0; - switch (strlen(arg)) { - case 12: /* CCYYMMDDhhmm */ - t->tm_year = ATOI2(arg); - t->tm_year *= 100; - yearset = 1; - /* FALLTHOUGH */ - case 10: /* YYMMDDhhmm */ - if (yearset) { - yearset = ATOI2(arg); - t->tm_year += yearset; - } else { - yearset = ATOI2(arg); - if (yearset < 69) - t->tm_year = yearset + 2000; - else - t->tm_year = yearset + 1900; - } - t->tm_year -= 1900; /* Convert to UNIX time. */ - /* FALLTHROUGH */ - case 8: /* MMDDhhmm */ - t->tm_mon = ATOI2(arg); - --t->tm_mon; /* Convert from 01-12 to 00-11 */ - t->tm_mday = ATOI2(arg); - t->tm_hour = ATOI2(arg); - t->tm_min = ATOI2(arg); - break; - case 4: /* hhmm */ - t->tm_hour = ATOI2(arg); - t->tm_min = ATOI2(arg); - break; - default: - goto terr; - } - t->tm_isdst = -1; /* Figure out DST. */ - timet = mktime(t); - if (timet == -1) -terr: errx(1, - "out of range or illegal time specification: [[CC]YY][MMDD]hhmm[.SS]"); - return timet; + time_t timet; + struct tm *t; + int yearset; + char *p; + + /* Start with the current time. */ + if (time(&timet) < 0) + err(1, "time"); + if ((t = localtime(&timet)) == NULL) + err(1, "localtime"); + + /* [[yy]yy][mmdd]hhmm[.ss] */ + if ((p = strchr(arg, '.')) == NULL) + t->tm_sec = 0; /* Seconds defaults to 0. */ + else { + if (strlen(p + 1) != 2) + goto terr; + *p++ = '\0'; + t->tm_sec = ATOI2(p); + } + + yearset = 0; + switch (strlen(arg)) { + case 12: /* ccyymmddhhmm */ + t->tm_year = ATOI2(arg); + t->tm_year *= 100; + yearset = 1; + /* FALLTHOUGH */ + case 10: /* yymmddhhmm */ + if (yearset) { + yearset = ATOI2(arg); + t->tm_year += yearset; + } else { + yearset = ATOI2(arg); + if (yearset < 69) + t->tm_year = yearset + 2000; + else + t->tm_year = yearset + 1900; + } + t->tm_year -= 1900; /* Convert to UNIX time. */ + /* FALLTHROUGH */ + case 8: /* MMDDhhmm */ + t->tm_mon = ATOI2(arg); + --t->tm_mon; /* Convert from 01-12 to 00-11 */ + t->tm_mday = ATOI2(arg); + t->tm_hour = ATOI2(arg); + t->tm_min = ATOI2(arg); + break; + case 4: /* hhmm */ + t->tm_hour = ATOI2(arg); + t->tm_min = ATOI2(arg); + break; + default: + goto terr; + } + t->tm_isdst = -1; /* Figure out DST. */ + timet = mktime(t); + if (timet == -1) +terr: errx(1, + "out of range or illegal time specification: [[yy]yy][mmdd]hhmm[.ss]"); + return timet; } |