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.

From-SVN: r223084
This commit is contained in:
Tom de Vries 2015-05-12 16:23:03 +00:00 committed by Tom de Vries
parent eb2f4e8647
commit 4171ffe90d
2 changed files with 16 additions and 3 deletions

View file

@ -1,3 +1,8 @@
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.
2015-05-12 Yury Gribov <y.gribov@samsung.com>
* mklog: Ignore preprocessor directives.

View file

@ -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 (){