Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Jul 2001 14:11:01 -0400 (EDT)
From:      Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org
Subject:   RE: cvs commit: src/usr.sbin/newsyslog Makefile newsyslog.c
Message-ID:  <200107301811.f6UIB1J00180@khavrinen.lcs.mit.edu>
In-Reply-To: <XFMail.010730103342.jhb@FreeBSD.org>
References:  <200107301541.f6UFfLQ59594@freefall.freebsd.org> <XFMail.010730103342.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
<<On Mon, 30 Jul 2001 10:33:42 -0700 (PDT), John Baldwin <jhb@FreeBSD.org> said:

> Why not make the 'ul' variable (icky name) a long and use strtol() instead? 
> Then you don't need all the (unsigned) casts for all the comparisons.

It looks like someone cut-and-pasted my canonical `parse an integer
correctly' code into a new function where the results were not used
carefully.  It would be an error to use `strtol' to parse a number
which is not supposed to be negative.

Note that the `parseDWM' format is bogus in more then one way:

- The `Dhh' and `Mdd[Dhh]' forms are redundant; the existing ISO 8601
parser handles these cases correctly.

- The `Dhh' notation is confusing; one might interpret it to mean
``day hh'' rather than ``every day at hour hh''.  Likewise with the
`Mdd' form.

- ISO 8601 specifies a standard notion for week-of-year and day within
that week; the `W' notation should instead have implemented that.  (I
wouldn't mind seeing my restricted 8601 parser replaced by one which
implemented the full glory of the specification.)

Also, note revs. 1.23 and 1.24 should be revisited in light of recent
changes to `chown' and other programs which accept a user and group.

-GAWollman

--
Garrett A. Wollman   | O Siem / We are all family / O Siem / We're all the same
wollman@lcs.mit.edu  | O Siem / The fires of freedom 
Opinions not those of| Dance in the burning flame
MIT, LCS, CRS, or NSA|                     - Susan Aglukark and Chad Irschick

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200107301811.f6UIB1J00180>