aboutsummaryrefslogtreecommitdiffstats
path: root/indent.sh
diff options
context:
space:
mode:
Diffstat (limited to 'indent.sh')
-rwxr-xr-xindent.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/indent.sh b/indent.sh
index 9885e49..3cb0e1f 100755
--- a/indent.sh
+++ b/indent.sh
@@ -4,5 +4,12 @@
# -l120 Set maximum line length for non-comment lines to 150.
# -pmt Preserve access and modification times on output files.
-indent -kr -l120 -pmt *.c *.h
+indent -kr -l120 *.c *.h
+for i in *.c *.h; do
+ if !(diff -q $i $i~); then
+ rm $i~
+ else
+ mv $i~ $i
+ fi
+done