https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279303

--- Comment #4 from Joshua Kinard <free...@kumba.dev> ---
(In reply to Joshua Kinard from comment #3)

Why is it always the little things that hide the deepest of rabbit holes?

I dug back into FreeBSD's cgit history, and it looks like the 'p'/'P' flag
(take your pick) was added on 2017-12-31 by @eadler, tracked by git commit
df76ac99518d.  In that commit, the flag was added as lowercase to the
newsyslog.conf.5 man page, and to the newsyslog.c source file as lower case.

I then went and looked into NetBSD's source, and they have ALL of the
newsyslog.conf flags they support listed in their man page as lowercase, but in
their newsyslog.c, they convert those flags to uppercase before checking them
in a switch statement, which is the opposite of what FreeBSD is doing.

Digging further back, I think it's around NetBSD 1.6 is when support for those
flags even first appeared, including 'p'.  In that version, in newsyslog.c,
NetBSD checks for lowercase flags.  On 2007-21-12. when NetBSD was at v5.0, the
'J' flag was added to NetBSD's newsyslog.c by @dogcow, and at that time is when
they modified the switch logic to check for uppercase flags, but added the 'J'
flag to the man page as lowercase 'j', and did not leave a reasoning on these
differences in their commit message:
https://anonhg.netbsd.org/src/rev/e97bbfc29eff

Which is correct?  Both, technically!  Historically, lowercase letters were
first, in both NetBSD's man pages and source.  Then the source later got
updated to check the flags as uppercase values, but the man page still, to this
day, references lower case.  FreeBSD, on the other hand, is using uppercase
flags in its newsyslog.conf(5) man page and config examples, except for 'p',
but checks the flags as all lower case, which was the original logic from
NetBSD.  I assume that when the code for the 'p' flag was copied from NetBSD
and brought into FreeBSD, @eadler either didn't notice such a small nit, or
didn't care.  Both upper and lowercase flag values are technically valid,
because in either OS, the values are forced into one or the other case before
being checked.

If y'all want, I have no problem leaving the flag in the man page as-is as a
historical curiosity for someone to find again in the future.  Or, the patch
can be accepted and the flag changed to uppercase in FreeBSD's man page for
consistency with the other flags.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to