Discussion:
bug#5776: [bug #29349] ls.c missing HAVE_NL_LANGINFO check
(too old to reply)
Alan Hourihane
2010-03-26 14:04:53 UTC
Permalink
URL:
<http://savannah.gnu.org/bugs/?29349>

Summary: ls.c missing HAVE_NL_LANGINFO check
Project: GNU Core Utilities
Submitted by: alanh
Submitted on: Fri Mar 26 14:04:52 2010
Category: None
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any

_______________________________________________________

Details:

Attached patch.



_______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Fri Mar 26 14:04:52 2010 Name: month.patch Size: 557B By: alanh

<http://savannah.gnu.org/bugs/download.php?file_id=20037>

_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?29349>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Eric Blake
2010-03-26 15:12:59 UTC
Permalink
Follow-up Comment #1, bug #29349 (project coreutils):

abmon_init is already conditional; it returns 0 if HAVE_NL_LANGINFO is not
defined. I think a better patch would be something that unconditionally fixes
the logic to deal with abmon_init returning 0 because we can't determine a
variable size, rather than adding #ifdefs.

But why do we need this in the first place? Doesn't gnulib guarantee the
existence of nl_langinfo()?


_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?29349>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Alan Hourihane
2010-03-26 15:24:39 UTC
Permalink
Follow-up Comment #2, bug #29349 (project coreutils):

I've be fine with adding logic to deal with abmon_init returning 0 too.

Let me know if I should test something.

_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?29349>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Alan Hourihane
2010-03-26 15:27:46 UTC
Permalink
Follow-up Comment #3, bug #29349 (project coreutils):

Actually, I think it's just because required_mon_width is never initialized
to 0 and it's never set in this case.


_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?29349>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Alan Hourihane
2010-03-26 15:54:25 UTC
Permalink
Follow-up Comment #5, bug #29349 (project coreutils):

O.k. But the problem is that when abmon_init returns 0 we get the horrible
error message for the case that we don't have HAVE_NL_LANGINFO. And given that
abmon_init() already contains this check, we should probably just move the
check to around the abmon_init() call as in the attached patch and remove the
if/endif in abmon_init() itself.

_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?29349>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Assaf Gordon
2018-10-30 04:46:51 UTC
Permalink
tags 5783 fixed
close 5783
stop

triaging very old bug: https://debbugs.gnu.org/5783
and https://savannah.gnu.org/bugs/?29349 .

In 2016, Paul committed the following:

ls: fix %%b format and precompute more
https://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=1db94ee969b984bbd00b97c6abbe2f69db8e0000

Which I believe fixes the ls/month issue
(compare the commit with the suggested patch from 2010:
https://savannah.gnu.org/bugs/download.php?file_id=20037 ).

As such, I'm closing this bug (if that's wrong, re-open it).
Discussion can continue by replying to this thread.

-assaf

Eric Blake
2010-03-26 15:48:13 UTC
Permalink
Follow-up Comment #4, bug #29349 (project coreutils):

Huh? Notice that required_mon_width is declared at file scope, with the
static modifier. C89 _guarantees_ that it is therefore initialized to 0 at
program startup. The comment above its declaration states that 0 means to not
use precomputed values, so obviously the intent is that the rest of the file
should be able to deal with it being 0.

_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?29349>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Loading...