Skip to content

Commit

Permalink
find_stray_empty_lines: make it work
Browse files Browse the repository at this point in the history
Signed-off-by: Bernhard Reutner-Fischer <[email protected]>
  • Loading branch information
aldot committed Jul 28, 2010
1 parent a3f7100 commit 3d615b8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions scripts/find_stray_empty_lines
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ grep -n -B1 -r $'^\t*}' . | grep -A1 '.[ch]-[0-9]*-$'
grep -n -A1 -r $'^\t*{' . | grep -B1 '.[ch]-[0-9]*-$'

# find trailing empty lines
find -type f | xargs tail -n1 | while read file; do
find -type f | while read file; do
test x"$file" = x"" && continue
read lastline
#echo "|$file|$lastline"
if test x"$lastline" = x""; then
tail -n1 $file | while read lastline
do
#echo "|$file|$lastline"
if test x"$lastline" = x""; then
echo "$file"
fi
fi
done
done

0 comments on commit 3d615b8

Please sign in to comment.