64e7ee93a34ccadcaf831c18ed0ee95f93bcca7c
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
* %sccs.include.redist.c%
static char sccsid
[] = "@(#)util.c 8.2 (Berkeley) %G%";
{ -1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
{ "January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November",
(void)sprintf(tbuf
, "%s %d, %d", months
[tp
->tm_mon
],
tp
->tm_mday
, tp
->tm_year
+ TM_YEAR_BASE
);
if (!(t
= strtok(p
, " \t")))
for (mp
= months
;; ++mp
) {
if (!strncasecmp(*mp
, t
, 3)) {
if (!(t
= strtok((char *)NULL
, " \t,")) || !isdigit(*t
))
if (!(t
= strtok((char *)NULL
, " \t,")) || !isdigit(*t
))
if (day
< 1 || day
> 31 || month
< 1 || month
> 12 || !year
)
tval
= isleap(year
) && month
> 2;
for (--year
; year
>= EPOCH_YEAR
; --year
)
DAYSPERLYEAR
: DAYSPERNYEAR
;
tval
= tval
* HOURSPERDAY
* MINSPERHOUR
* SECSPERMIN
;
while (sh
= getusershell()) {
/* allow just shell name, but use "real" path */
if ((p
= rindex(sh
, '/')) && !strcmp(name
, p
+ 1))