-# NOTE: "touch mydir/no-indent" to make the tree starting at mydir untouchable
-l=""
-for n in `find . -name "no-indent"`
-do
- n=`dirname "$n"`
- l="-and -not -path \"$n/*\" $l"
-done
-indent -nut `echo $l | xargs find . -name "*.c"`
-indent -nut `echo $l | xargs find . -name "*.h"`
+# Run this script to indent the GNUnet code. When run without arguments,
+# it indents the ENTIRE src/ tree. Run with 'src/XXX' to indent the
+# src/XXX directory.
+if test $# = 0
+then
+ PATHS=src/
+else
+ PATHS="$@"
+fi
+find $PATHS -name "*.c" -exec indent {} \;
+find $PATHS -name "*.h" -exec indent {} \;
+find $PATHS -name "*.c" -exec indent {} \;
+find $PATHS -name "*.h" -exec indent {} \;
+find $PATHS -name "*.c" -exec contrib/removetrailingwhitespace {} \;
+find $PATHS -name "*.h" -exec contrib/removetrailingwhitespace {} \;