Skip to content

Commit 119be72

Browse files
Peter Oberparleiteroberpar
authored andcommitted
geninfo: Fix handling of non-english locales
geninfo expects gcov output in the default C locale. This isn't always given, for example when running in an environment where variable LANGUAGE is set to a non-english locale. In such cases gcov output cannot be correctly parsed, resulting for example in the absence of branch coverage data. gcov uses gettext() for writing internationalized messages. The info page for gettext mentions the order in which locale-defining environment variables are evaluated: LANGUAGE LC_ALL LC_MESSAGES LANG In addition, gettext implements special handling where LC_ALL=C takes precedence over LANGUAGE. geninfo currently only specifies LANG=C. Fix the issue by specifying LC_ALL=C instead. Based on fix suggestion by Sebastian Stigler. Reported-by: Sebastian Stigler <[email protected]>
1 parent 0f7bb3e commit 119be72

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bin/geninfo

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ if( $^O eq "msys" )
6161
}
6262

6363
# Constants
64-
our $lcov_version = 'LCOV version 1.11 pre (CVS $Revision: 1.122 $)';
64+
our $lcov_version = 'LCOV version 1.11 pre (CVS $Revision: 1.123 $)';
6565
our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php";
6666
our $gcov_tool = "gcov";
6767
our $tool_name = basename($0);
@@ -266,8 +266,8 @@ $SIG{__DIE__} = \&die_handler;
266266
# Prettify version string
267267
$lcov_version =~ s/\$\s*Revision\s*:?\s*(\S+)\s*\$/$1/;
268268

269-
# Set LANG so that gcov output will be in a unified format
270-
$ENV{"LANG"} = "C";
269+
# Set LC_ALL so that gcov output will be in a unified format
270+
$ENV{"LC_ALL"} = "C";
271271

272272
# Check command line for a configuration file name
273273
Getopt::Long::Configure("pass_through", "no_auto_abbrev");

0 commit comments

Comments
 (0)