diff options
author | vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-05-12 16:23:29 +0000 |
---|---|---|
committer | vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-05-12 16:23:29 +0000 |
commit | 93f7b419a927e642c44cc9d9ca834bd8f44fdd86 (patch) | |
tree | e91ecd949e4050990c4b6222c9f809f07bd44b68 /contrib | |
parent | 0b4a9aa24d9ded711f1f562077882c040d9b1736 (diff) | |
download | gcc-93f7b419a927e642c44cc9d9ca834bd8f44fdd86.tar.gz |
check_GNU_style.sh: Put stdin into temp file
2015-05-12 Tom de Vries <tom@codesourcery.com>
* check_GNU_style.sh: Put stdin into a temp file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223087 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/ChangeLog | 4 | ||||
-rwxr-xr-x | contrib/check_GNU_style.sh | 11 |
2 files changed, 13 insertions, 2 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog index da374975417..97941f77f00 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,5 +1,9 @@ 2015-05-12 Tom de Vries <tom@codesourcery.com> + * check_GNU_style.sh: Put stdin into a temp file. + +2015-05-12 Tom de Vries <tom@codesourcery.com> + * check_GNU_style.sh: Read either from stdin, or from files. 2015-05-12 Tom de Vries <tom@codesourcery.com> diff --git a/contrib/check_GNU_style.sh b/contrib/check_GNU_style.sh index f00b3d54096..318eb6adca5 100755 --- a/contrib/check_GNU_style.sh +++ b/contrib/check_GNU_style.sh @@ -40,8 +40,15 @@ nfiles=$# files="$*" stdin=false +stdin_tmp="" if [ $nfiles -eq 1 ] && [ "$files" = "-" ]; then stdin=true + + # By putting stdin into a temp file, we can handle it just like any other + # file. F.i., we can cat it twice, which we can't do with stdin. + stdin_tmp=check_GNU_style.stdin + cat - > $stdin_tmp + files=$stdin_tmp else for f in $files; do if [ "$f" = "-" ]; then @@ -60,8 +67,8 @@ inp=check_GNU_style.inp tmp=check_GNU_style.tmp # Remove $tmp on exit and various signals. -trap "rm -f $inp $tmp" 0 -trap "rm -f $inp $tmp ; exit 1" 1 2 3 5 9 13 15 +trap "rm -f $inp $tmp $stdin_tmp" 0 +trap "rm -f $inp $tmp $stdin_tmp; exit 1" 1 2 3 5 9 13 15 if [ $nfiles -eq 1 ]; then # There's no need for the file prefix if we're dealing only with one file. |