From: Daniel Arndt Date: Fri, 17 Jan 2020 16:31:04 +0000 (-0700) Subject: Fix removing trailing whitespaces X-Git-Tag: v9.2.0-rc1~644^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3ea47e581b3262a07c28aea861836d0ac7fb538;p=dealii.git Fix removing trailing whitespaces --- diff --git a/contrib/utilities/indent_common.sh b/contrib/utilities/indent_common.sh index d9c82e72d9..8861f659c7 100644 --- a/contrib/utilities/indent_common.sh +++ b/contrib/utilities/indent_common.sh @@ -163,12 +163,16 @@ format_file() export -f format_file # -# Remove trailing whitespace +# Remove trailiing whitespace. Mac OSX requires an extension for a backup file +# for in-place replacements. So we need to provide something before the regex. +# Using '-e' avoids creating these files on GNU platforms at least. +# For Mac OSX, we still need to delete the created file. # remove_trailing_whitespace() { - sed -i 's/\s\+$//g' $1 + sed -i -e 's/\s\+$//g' "$1" + rm -f "$1-e" } export -f remove_trailing_whitespace