[PATCH] ccwrap: fix build with non-english locale set

Patrick Bendorf mail@patrick-bendorf.de
Mon Feb 29 13:34:00 GMT 2016


sorry, now it's based on current git head. and hopefully without 
formatting issues.

/winsup/
* ccwrap: change locale to 'C' as ccwrap searches for literal strings 
"search starts here" and "End of search list" which may be localized.

---
  winsup/ccwrap | 6 +-----
  1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/winsup/ccwrap b/winsup/ccwrap
index 2f1fd3a..0c6a170 100755
--- a/winsup/ccwrap
+++ b/winsup/ccwrap
@@ -12,11 +12,7 @@ if ($ARGV[0] ne '++') {
      $cxx = 1;
  }
  die "$0: $ccorcxx environment variable does not exist\n" unless exists 
$ENV{$ccorcxx};
-if (`uname -o` =~ /cygwin/i) {
-    $ENV{'LANG'} = 'C.UTF-8';
-} else {
-    $ENV{'LANG'} = 'C';
-}
+$ENV{'LANG'} = 'C';
  my @compiler = split ' ', $ENV{$ccorcxx};
  if ("@ARGV" !~ / -nostdinc/o) {
      my $fd;
--
2.7.0

Am 29.02.2016 um 14:19 schrieb patrick bendorf:
> after some discussion on irc and the list i'm resubmitting a simpler 
> version of the patch.
> setting the locale on cygwin to 'C.UTF-8' is not needed, so i'm always 
> setting it to 'C' which is sufficient for the build process and the 
> most simple fix.
>
> /winsup/
> * ccwrap: change locale to 'C' as ccwrap searches for literal strings 
> "search starts here" and "End of search list" which may be localized.
> ---
>  winsup/ccwrap | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/winsup/ccwrap b/winsup/ccwrap
> index 7580e7a..0c6a170 100755
> --- a/winsup/ccwrap
> +++ b/winsup/ccwrap
> @@ -12,6 +12,7 @@ if ($ARGV[0] ne '++') {
>      $cxx = 1;
>  }
>  die "$0: $ccorcxx environment variable does not exist\n" unless 
> exists $ENV{$ccorcxx};
> +$ENV{'LANG'} = 'C';
>  my @compiler = split ' ', $ENV{$ccorcxx};
>  if ("@ARGV" !~ / -nostdinc/o) {
>      my $fd;
> -- 
> 2.7.0
>
> patrick
>
> Am 2016-02-29 13:58, schrieb Corinna Vinschen:
>> On Feb 29 12:46, Jon Turney wrote:
>>> On 29/02/2016 12:19, mail@patrick-bendorf.de wrote:
>>> >+if (`uname -o` =~ /cygwin/i) {
>>> >+    $ENV{'LANG'} = 'C.UTF-8';
>>> >+} else {
>>> >+    $ENV{'LANG'} = 'C';
>>>
>>> This can just say "$ENV{'LANG'} = 'C';" right? As that has to work
>>> everywhere?
>>
>> Uh, I missed that.  Yes, of course that should work, too.
>>
>>
>> Corinna



More information about the Cygwin-patches mailing list