From d86483b0c4be5298c96ccaaa62670a04b018af42 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 29 Jun 2017 18:06:11 -0700 Subject: [PATCH] tests: avoid false failure when run in qemu user mode * tests/filename-lineno.pl: Derive the program name that grep will use in diagnostics, based on a suggestion from Assaf Gordon. Reported by Bruno Haible in http://bugs.gnu.org/27532 --- tests/filename-lineno.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/filename-lineno.pl b/tests/filename-lineno.pl index 8eead57..6cc86b7 100755 --- a/tests/filename-lineno.pl +++ b/tests/filename-lineno.pl @@ -24,6 +24,9 @@ use strict; (my $program_name = $0) =~ s|.*/||; my $prog = 'grep'; +my $full_prog_name = `$prog --no-such-option 2>&1`; +$full_prog_name =~ s/:.*//s; +$prog = $full_prog_name if $full_prog_name; # Turn off localization of executable's output. @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; -- 2.13.0