[MPlayer-dev-eng] [PATCH] i18n fix for NetBSD

Frederick Bruckman fredb at immanent.net
Mon Feb 24 13:23:58 CET 2003


On Mon, 24 Feb 2003, D Richard Felker III wrote:

> On Sun, Feb 23, 2003 at 10:39:31PM -0600, Frederick Bruckman wrote:
> > Hi,
> >
> > NetBSD's bindtextdomain() clone is evidently deficient. It never
> > returns the second, dirname argument, but only the first on success
> > or NULL on any failure. Furthermore, it doesn't do anything different
> > if the second argument is NULL, so the call intended to query the
> > directory for the default domain was SEGV'ing.
> >
> > For mplayer, I wrote a configure test (rather than use __NetBSD__),
> > with the idea that NetBSD might get this fixed eventually.
> >
> > Note that it's not safe to use the return value of bindtextdomain()
> > in printf(), if it might be NULL. Does GNU's never return NULL?
>
> Passing NULL to printf is safe in all implementations I've seen, but
> I'm not sure the standard requires this. Any comments?

Oh. NetBSD 1.6.1_RC2 prints ``(null)'' for printf("%s",NULL). Never
mind that, then.

It's obvious to me that our bindtextdomain() is broken, and I'm still
curious as to what it's expected to do, if you give, say, a path
larger than PATH_MAX, if anyone wants to clue me in. (The docs don't
say anything about a return value. Feel free to reply off-list.) I'll
try to get that fixed for NetBSD 2.0, but on 1.6*, cvs mplayer detects
our libintl out-of-the-box, tries to use it, and falls on its face, so
IMHO some kind of work around is called for.

Frederick



More information about the MPlayer-dev-eng mailing list