|
|||||||||||
|
(patch) some fixes in last(1)
From: Andrey Matveev <andrushock(at)korovino.net>
Date: Sat Apr 05 2003 - 18:51:50 EST
Index: usr.bin/last/last.c RCS file: /cvs/src/usr.bin/last/last.c,v retrieving revision 1.21 diff -u -r1.21 last.c --- usr.bin/last/last.c 2003/04/05 16:24:59 1.21 +++ usr.bin/last/last.c 2003/04/05 22:41:06 @@ -570,7 +567,7 @@ /* * dateconv -- * Convert the snapshot time in command line given in the format - * [[CC]YY][MMDD]hhmm[.ss]] to a time_t. + * [[CC]YY][MMDD]hhmm[.SS]] to a time_t. * Derived from atime_arg1() in usr.bin/touch/touch.c */ time_t @@ -588,7 +585,7 @@
if ((t = localtime(&timet)) == NULL)
err(1, "localtime");
- /* [[yy]yy][mmdd]hhmm[.ss] */
+ /* [[CC]YY][MMDD]hhmm[.SS] */
if ((p = strchr(arg, '.')) == NULL)
t->tm_sec = 0; /* Seconds defaults to 0. */
else {
@@ -600,12 +597,12 @@
yearset = 0;
switch (strlen(arg)) {
- case 12: /* ccyymmddhhmm */
+ case 12: /* CCYYMMDDhhmm */
t->tm_year = ATOI2(arg);
t->tm_year *= 100;
yearset = 1;
/* FALLTHOUGH */
- case 10: /* yymmddhhmm */
+ case 10: /* YYMMDDhhmm */
if (yearset) {
yearset = ATOI2(arg);
t->tm_year += yearset;
}
@@ -657,4 +654,15 @@
if (signo == SIGINT)
exit(1);
(void)fflush(stdout); /* fix required for rsh */
+}
+
+void
+usage(void)
+{
+ extern char *__progname;
+
+ fprintf(stderr,
+ "usage: %s [-#] [-csT] [-f file] [-t tty] [-h host]"
+ " [-d [[CC]YY][MMDD]hhmm[.SS]] [user ...]\n", __progname);
+ exit(1);
} Received on Sat Apr 5 17:50:26 2003 This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 13:29:53 EDT |
||||||||||
|
|||||||||||