Description: Fix xml_grep producing invalid output when input from stdin
Bug-Debian: https://bugs.debian.org/691028
Author: Bart Martens <bartm@debian.org>
Reviewed-by: gregor herrmann <gregoa@debian.org>
Last-Update: 2025-08-23

--- a/tools/xml_grep/xml_grep
+++ b/tools/xml_grep/xml_grep
@@ -127,8 +127,10 @@
      
 my $t= create_twig( %options);
 
-if( @ARGV)
-  { foreach my $file (@ARGV)
+my @files = @ARGV;
+push @files, '-' unless @files; # fixes http://bugs.debian.org/691028
+if( @files)
+  { foreach my $file (@files)
       { $current_file= $file;
 
         if( $nb_results_per_file) { $nb_results_left_in_current_file= $nb_results_per_file; }
