diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-01-31 23:51:25 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-01-31 23:51:25 -0200 |
commit | 28af95926667ed6ee25e7a050286bb72f546438e (patch) | |
tree | 4decd2a6c1ce1a0f68c332c260d4caeb0b3cfc28 | |
parent | df5ff3de51376ebc830fbf4d0f642d31378d7013 (diff) | |
download | mediapointer-dvb-s2-28af95926667ed6ee25e7a050286bb72f546438e.tar.gz mediapointer-dvb-s2-28af95926667ed6ee25e7a050286bb72f546438e.tar.bz2 |
Fixed a bug at strip-trailing-whitespaces
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Sometimes, it was needed to run it several times. fixed.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rwxr-xr-x | v4l/scripts/strip-trailing-whitespaces.sh | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/v4l/scripts/strip-trailing-whitespaces.sh b/v4l/scripts/strip-trailing-whitespaces.sh index ea3e4defa..1a23e436d 100755 --- a/v4l/scripts/strip-trailing-whitespaces.sh +++ b/v4l/scripts/strip-trailing-whitespaces.sh @@ -10,21 +10,25 @@ for file in `find linux -type d | grep -v CVS | grep -v .cvsignore` ; do done for file in `find linux -type f | grep -v CVS | grep -v .cvsignore` ; do tmpfile="$WORK/${file}.$$" - perl -ne 's/[ \t]+$//; + perl -ne 's/[ \t]+$//; s/^\ \ \ \ \ \ \ \ /\t/; s/^\ \ \ \ \ \ \ \t/\t/; s/^\ \ \ \ \ \ \t/\t/; s/^\ \ \ \ \ \t/\t/; s/^\ \ \ \t/\t/; s/^\ \ \t/\t/; - s/^\ \t/\t/; - s/\t\ \ \ \ \ \ \ \ /\t\t/g; - s/\t\ \ \ \ \ \ \ \t/\t\t/g; - s/\t\ \ \ \ \ \ \t/\t\t/g; - s/\t\ \ \ \ \ \t/\t\t/g; - s/\t\ \ \ \t/\t\t/g; - s/\t\ \ \t/\t\t/g; - s/\t\ \t/\t\t/g; + s/^\ \t/\t/; + $m=1; + while ($m>0) { + $m=0; + $m= s/\t\ \ \ \ \ \ \ \ /\t\t/g; + $m=$m+s/\t\ \ \ \ \ \ \ \t/\t\t/g; + $m=$m+s/\t\ \ \ \ \ \ \t/\t\t/g; + $m=$m+s/\t\ \ \ \ \ \t/\t\t/g; + $m=$m+s/\t\ \ \ \t/\t\t/g; + $m=$m+s/\t\ \ \t/\t\t/g; + $m=$m+s/\t\ \t/\t\t/g; + } print' < "${file}" > "${tmpfile}" diff -u "${file}" "${tmpfile}" | sed \ -e "s|^--- ${file}|--- ${file}.orig|" \ |