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



On 19 Apr 2001, Nick Clifton wrote:

> 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:
> ought to be changed to:
> > +#if defined isascii && ! defined HAVE_LOCALE_H

OK, lets use this code, it should work (with a small syntax change):
-#ifdef isascii
+#if defined isascii && !defined HAVE_LOCALE_H

Regards
Michal
--- binutils-2.10.91.0.4/binutils/strings.c.orig	Wed Apr 25 10:21:09 2001
+++ binutils-2.10.91.0.4/binutils/strings.c	Wed Apr 25 10:30:12 2001
@@ -76,7 +76,7 @@
 #endif
 #endif
 
-#ifdef isascii
+#if defined isascii && !defined HAVE_LOCALE_H
 #define isgraphic(c) (isascii (c) && (isprint (c) || (c) == '\t'))
 #else
 #define isgraphic(c) (isprint (c) || (c) == '\t')
@@ -141,7 +141,7 @@
   boolean files_given = false;
 
 #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
-  setlocale (LC_MESSAGES, "");
+  setlocale (LC_ALL, "");
 #endif
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);

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