Subject: Re: pkg/20978: mail/deliver is not compatible with recent NetBSD libc
To: Ben Harris <bjh21@netbsd.org>
From: Giles Lean <giles@nemeton.com.au>
List: current-users
Date: 04/08/2003 10:05:25
Ben Harris wrote:
> Has anyone come up with any rationale _for_ the change? "It's permitted by
> X/Open" is hardly much of a reason on its own.
If basename() and dirname() stomp on their input then they can't be
used to operate on constant strings. The new implementation can.
Library routines that modify their input are hardly re-entrant so for
the new implementation to be obviously non-reentrant is no loss.
You could argue that since basename() and dirname() both take 'char *'
that passing them pointers to constant strings is an application bug
... borderline, IMHO.
Whether the routine should have been versioned for this change I don't
know, but I do like the new implementation better.
| revision 1.5
| date: 2002/10/17 02:06:04; author: thorpej; state: Exp; lines: +26 -14
| Change basename(3) and dirname(3) to return a pointer to static
| storage, rather than modifying their input arguments. While not
| reentrant, this is explcitly allowed by IEEE Std 1003.1-2001 (which
| allows either behavior, stating that it is implementation-dependent).
Regards,
Giles