From 12367d84442749d31f6a9750eb3defdfc33f661b Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Tue, 8 Sep 2015 09:35:04 -0700 Subject: [PATCH] whitespace-purge: switch from sed to perl The perl form is more portable. --- contrib/whitespace-purge.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/whitespace-purge.sh b/contrib/whitespace-purge.sh index 729c27549c..9c9d8fe909 100755 --- a/contrib/whitespace-purge.sh +++ b/contrib/whitespace-purge.sh @@ -3,6 +3,7 @@ # Copyright (c) 2015 Intel, Inc. All rights reserved. # Copyright (c) 2015 Los Alamos National Security, LLC. All rights # reserved +# Copyright (c) 2015 Cisco Systems, Inc. # $COPYRIGHT$ # # Additional copyrights may follow @@ -18,6 +19,7 @@ for file in $(git ls-files) ; do # skipped add the check here. type=$(file -b --mime-type -h $file) if test ${type::4} == "text" ; then - LC_ALL=C sed -i '' -E "s/[[:space:]]*$//" $file + # Eliminate whitespace at the end of lines + perl -pi -e 's/\s*$/\n/' $file fi done