diff options
author | Gerd Knorr <devnull@localhost> | 2004-10-13 10:38:59 +0000 |
---|---|---|
committer | Gerd Knorr <devnull@localhost> | 2004-10-13 10:38:59 +0000 |
commit | edd4507a9edff255a67ce707442560a4ec4b3b14 (patch) | |
tree | d7c709acacb87b01d70340692df17aebcfbe2913 /v4l/scripts | |
parent | c391a6857f19bd7eb8b9a40dc238242c34332f7a (diff) | |
download | mediapointer-dvb-s2-edd4507a9edff255a67ce707442560a4ec4b3b14.tar.gz mediapointer-dvb-s2-edd4507a9edff255a67ce707442560a4ec4b3b14.tar.bz2 |
- kill trailing whitespaces.
Diffstat (limited to 'v4l/scripts')
-rw-r--r-- | v4l/scripts/strip-trailing-whitespaces.sh | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/v4l/scripts/strip-trailing-whitespaces.sh b/v4l/scripts/strip-trailing-whitespaces.sh index 592320e6a..6e6c7d8bb 100644 --- a/v4l/scripts/strip-trailing-whitespaces.sh +++ b/v4l/scripts/strip-trailing-whitespaces.sh @@ -1,8 +1,15 @@ #!/bin/sh + +# tmp dir for my files +WORK="${TMPDIR-/tmp}/${0##*/}-$$" +mkdir "$WORK" || exit 1 +trap 'rm -rf "$WORK"' EXIT + for file in *.[ch]; do - echo "### file" - tmpfile="${file}.$$" - perl -ne 's/[ \t]+$//; print' < "${file}" > "$tmpfile" - diff -u "$file" "$tmpfile" + tmpfile="$WORK/${file}.$$" + perl -ne 's/[ \t]+$//; print' < "${file}" > "${tmpfile}" + diff -u "${file}" "${tmpfile}" | sed \ + -e "s|^--- ${file}|--- ${file}.orig|" \ + -e "s|^+++ ${tmpfile}|+++ ${file}|" rm -f "$tmpfile" done |