diff options
author | vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-05-12 16:23:03 +0000 |
---|---|---|
committer | vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-05-12 16:23:03 +0000 |
commit | 8e7b874b68f60f7ab2e826f25cddf55da0fe33ee (patch) | |
tree | 8980db73f201b78c7e31d0ac2861c211f8489fd0 /contrib/check_GNU_style.sh | |
parent | 1fe5296b8d2e91015d2d81519f1ddaa125120ba8 (diff) | |
download | gcc-8e7b874b68f60f7ab2e826f25cddf55da0fe33ee.tar.gz |
check_GNU_style.sh: Don't use filename prefix for one patch
2015-05-12 Tom de Vries <tom@codesourcery.com>
* check_GNU_style.sh: Don't use a filename prefix if we're only
processing one patch file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223084 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'contrib/check_GNU_style.sh')
-rwxr-xr-x | contrib/check_GNU_style.sh | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/contrib/check_GNU_style.sh b/contrib/check_GNU_style.sh index e8d5dcaf7bc..eeff48f8c4c 100755 --- a/contrib/check_GNU_style.sh +++ b/contrib/check_GNU_style.sh @@ -36,6 +36,8 @@ EOF } test $# -eq 0 && usage +nfiles=$# +files="$*" inp=check_GNU_style.inp tmp=check_GNU_style.tmp @@ -44,9 +46,15 @@ tmp=check_GNU_style.tmp trap "rm -f $inp $tmp" 0 trap "rm -f $inp $tmp ; exit 1" 1 2 3 5 9 13 15 -grep -nH '^+' $* \ - | grep -v ':+++' \ - > $inp +if [ $nfiles -eq 1 ]; then + # There's no need for the file prefix if we're dealing only with one file. + format="-n" +else + format="-nH" +fi +grep $format '^+' $files \ + | grep -v ':+++' \ + > $inp # Grep g (){ |