From 90ee335724c3165ae31bfc45486a1c185d85a19c Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sun, 9 Sep 2012 22:52:50 +0000 Subject: Get error messages in the C locale for comparision with make output. Fixes Savannah bug #35764. --- tests/scripts/functions/file | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/scripts/functions/file') diff --git a/tests/scripts/functions/file b/tests/scripts/functions/file index b994af8..9a4cd02 100644 --- a/tests/scripts/functions/file +++ b/tests/scripts/functions/file @@ -35,9 +35,16 @@ touch('file.out'); chmod(0444, 'file.out'); # Find the error that will be printed +# This seems complicated, but we need the message from the C locale +my $loc = undef; +if ($has_POSIX) { + $loc = POSIX::setlocale(POSIX::LC_MESSAGES); + POSIX::setlocale(POSIX::LC_MESSAGES, 'C'); +} my $e; open(my $F, '>', 'file.out') and die "Opened read-only file!\n"; $e = "$!"; +$loc and POSIX::setlocale(POSIX::LC_MESSAGES, $loc); run_make_test(q! define A -- cgit v1.2.3