From a118732d1138b169e3c41759b8e3e03945994172 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Tue, 15 Feb 2011 12:45:28 +0100 Subject: [PATCH] test defs: add subroutine for input unindenting * tests/defs.in (unindent): New subroutine. --- ChangeLog | 6 ++++++ tests/defs.in | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/ChangeLog b/ChangeLog index fa53707..4563585 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-02-16 Stefano Lattarini + Ralf Wildenhues + + test defs: add subroutine for input unindenting + * tests/defs.in (unindent): New subroutine. + 2011-02-15 Stefano Lattarini python: report the 'PYTHON' influential environment variable diff --git a/tests/defs.in b/tests/defs.in index eb92caa..ffe21e1 100644 --- a/tests/defs.in +++ b/tests/defs.in @@ -440,6 +440,24 @@ AUTOMAKE_fails () AUTOMAKE_run 1 ${1+"$@"} } +# unindent [input files...] +# ------------------------- +# Remove the "proper" amount of leading whitespace from the given files, +# and output the result on stdout. That amount is determined by looking +# at the leading whitespace of the first non-blank line in the input +# files. If no input file is specified, standard input is implied. +unindent () +{ + cat ${1+"$@"} > deindent.tmp + indentation=`sed