This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Correctly localized strings


Hi Michal,

> However, it is needed to correctly initialize locales in the strings.
> Now, only messages are used (LC_MESSAGES), it is needed to init all
> locales (LC_ALL).

This first part of your patch seems fine.

> And finally, use the isprint function, not isascii, as not all local
> characters are ascii.

This second part has a problem though.  On some, older, systems,
isprint() is only defiend to work on values that are accepted by
isascii() and using values outside of that range will produce
segmentation faults. 

I think that perhaps this part of your patch:

> -#ifdef isascii
> -#define isgraphic(c) (isascii (c) && (isprint (c) || (c) == '\t'))
> -#else
>  #define isgraphic(c) (isprint (c) || (c) == '\t')
> -#endif

ought to be changed to:

> +#if defined isascii && ! defined HAVE_LOCALE_H
>  #define isgraphic(c) (isascii (c) && (isprint (c) || (c) == '\t'))
>  #else
>  #define isgraphic(c) (isprint (c) || (c) == '\t')
>  #endif

Does this work on your system ?

Cheers
        Nick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]