(_at_replace): Do the substitution only if there's something to replace.
authorJim Meyering <jim@meyering.net>
Mon, 2 Dec 2002 09:30:41 +0000 (09:30 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 2 Dec 2002 09:30:41 +0000 (09:30 +0000)
tests/Fetish.pm

index cdd09fa..f063de5 100644 (file)
@@ -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;
 }