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 authentication level.

bug #29349: ls.c missing HAVE_NL_LANGINFO check

Submitter:  Alan Hourihane <alanh>
Submitted:  Fri 26 Mar 2010 02:04:52 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Fri 26 Mar 2010 03:54:24 PM UTC, 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 26 Mar 2010 03:48:13 PM UTC, 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>
Group administrator
Fri 26 Mar 2010 03:27:46 PM UTC, 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 26 Mar 2010 03:24:38 PM UTC, 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 26 Mar 2010 03:12:58 PM UTC, 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>
Group administrator
Fri 26 Mar 2010 02:04:52 PM UTC, original submission:  

Attached patch.

Alan Hourihane <alanh>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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
  • -email is unavailable- added by ericb (Posted a comment)
  • -email is unavailable- added by alanh (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-03-26 alanh Attached File- Added month.patch, #20037

    Back to the top

    Powered by Savane 3.13-269c.
    Corresponding source code