* automake.in (verbatim): If used in empty context, continue to act
as before, and append the read makefile fragment to '$output_verbatim'.
But if used in scalar or list context, return it instead.

Signed-off-by: Stefano Lattarini <[email protected]>
---
 automake.in | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/automake.in b/automake.in
index 4e6f02c..f6ae1a7 100644
--- a/automake.in
+++ b/automake.in
@@ -5830,7 +5830,18 @@ sub almost_verbatim ($%)
 sub verbatim ($)
 {
   my $name = shift;
-  $output_verbatim .= slurp_makefile_fragment ("$libdir/am/$name.am");
+  my $text .= slurp_makefile_fragment ("$libdir/am/$name.am");
+  if (defined wantarray)
+    {
+      # Scalar or list context.
+      return $text;
+    }
+  else
+    {
+      # Void context
+      $output_verbatim .= $text;
+      return;
+    }
 }
 
 # @PARAGRAPHS
-- 
1.7.12.rc0


Reply via email to