From 19b3648d1565af8cb838f5ce058d86e9b4ed8ef2 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 2 Dec 2002 09:30:41 +0000 Subject: (_at_replace): Do the substitution only if there's something to replace. --- tests/Fetish.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/Fetish.pm b/tests/Fetish.pm index cdd09fa18..f063de54b 100644 --- a/tests/Fetish.pm +++ b/tests/Fetish.pm @@ -12,7 +12,7 @@ use FileHandle; use File::Compare qw(compare); @ISA = qw(Exporter); -($VERSION = '$Revision: 1.11 $ ') =~ tr/[0-9].//cd; +($VERSION = '$Revision: 1.12 $ ') =~ tr/[0-9].//cd; @EXPORT = qw (run_tests); my $debug = $ENV{DEBUG}; @@ -168,7 +168,9 @@ sub _at_replace ($$) foreach my $eo (qw (AUX OUT ERR)) { my $f = $map->{$eo}; - $f and $s =~ s/\@$eo\@/$f/g; + $f + and $s =~ /\@$eo\@/ + and $s =~ s/\@$eo\@/$f/g; } return $s; } -- cgit v1.2.3-70-g09d2