aboutsummaryrefslogtreecommitdiffstats
path: root/indent.sh
blob: 3cb0e1fb2afd91108da96ecf3a9107aeed91586a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#! /bin/bash

# -kr    Use Kernighan & Ritchie coding style.
# -l120  Set maximum line length for non-comment lines to 150.
# -pmt   Preserve access and modification times on output files.

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