]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
autom4te: fix problem when tracing to '-'
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 15 Mar 2016 17:51:26 +0000 (10:51 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 15 Mar 2016 17:51:53 +0000 (10:51 -0700)
* bin/autom4te.in (handle_traces): When $output is '-', use
stdout rather than creating a file named '-'.  This fixes a problem
introduced by the recent port to the new Autom4te::XFile API.

bin/autom4te.in

index 591771b270e71e6669a4a994b9ec474b0972b353..59945cf208188c3970d99621d490268a9d2ea432 100644 (file)
@@ -550,7 +550,7 @@ sub handle_output ($$)
     }
   else
     {
-      $out->open($output, O_CREAT | O_WRONLY | O_TRUNC, oct ($mode));
+      $out->open ($output, O_CREAT | O_WRONLY | O_TRUNC, oct ($mode));
     }
   fatal "cannot create $output: $!"
     unless $out;
@@ -834,7 +834,15 @@ EOF
   $trace_m4->close;
 
   my $in = new Autom4te::XFile ("$m4 " . shell_quote ("$tmp/traces.m4") . " |");
-  my $out = new Autom4te::XFile ($output, ">");
+  my $out = new Autom4te::XFile;
+  if ($output eq '-')
+    {
+      $out->open (">$output");
+    }
+  else
+    {
+      $out->open ($output, ">");
+    }
 
   # This is dubious: should we really transform the quadrigraphs in
   # traces?  It might break balanced [ ] etc. in the output.  The