bugGNU Core Utilities - Bugs: bug #29349, ls.c missing HAVE_NL_LANGINFO check


You are not allowed to post comments on this tracker with your current authentification level.

bug #29349: ls.c missing HAVE_NL_LANGINFO check

Submitted by:  Alan Hourihane <alanh>
Submitted on:  Fri Mar 26 14:04:52 2010  
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Fri Mar 26 15:54:24 2010, comment #5:

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.

Alan Hourihane <alanh>
Fri Mar 26 15:48:13 2010, comment #4:

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.

Eric Blake <ericb>
Project Administrator
Fri Mar 26 15:27:46 2010, comment #3:

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

Alan Hourihane <alanh>
Fri Mar 26 15:24:38 2010, comment #2:

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

Let me know if I should test something.

Alan Hourihane <alanh>
Fri Mar 26 15:12:58 2010, comment #1:

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()?

Eric Blake <ericb>
Project Administrator
Fri Mar 26 14:04:52 2010, original submission:

Attached patch.

Alan Hourihane <alanh>


Attached Files
file #20037:  month.patch added by alanh (557B - text/x-patch)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by ericb (Posted a comment)
  • -unavailable- added by alanh (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri Mar 26 14:04:52 2010alanhAttached File-=>Added month.patch, #20037

    Back to the top

    Powered by Savane 3.1-cleanup1