This is the mail archive of the
mailing list for the Cygwin project.
nl_langinfo returning null?
- From: Charles Wilson <cygwin at cwilson dot fastmail dot fm>
- To: cygwin at cygwin dot com
- Date: Fri, 09 Apr 2010 16:24:59 -0400
- Subject: nl_langinfo returning null?
I've noticed that bsdtar.exe has been coredumping occasionally. I've
tracked it down to a behavioral change in recent cygwin DLLs. This line
bsdtar->day_first = (*nl_langinfo(D_MD_ORDER) == 'd');
causes a segfault, because nl_langinfo returns null. However, according
"In a locale where langinfo data is not defined, nl_langinfo() shall
return a pointer to the corresponding string in the POSIX locale. In all
locales, nl_langinfo() shall return a pointer to an empty string if item
contains an invalid setting."
Now, this doesn't always happen; I only see it when I run bsdtar.exe in
mintty, but not if I run it in rxvt-unicode, rxvt, cmd/bash, ...
So, it seems to be a weird interaction with something mintty is doing,
and the i18n stuff, but...regardless, cygwin's nl_langinfo() should
never return null.
FWIW, I've put a workaround in bsdtar.c, and will be uploading a new
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple