diff --git a/bacnet-stack/.indent.pro b/bacnet-stack/.indent.pro index 730092bc..9baced44 100644 --- a/bacnet-stack/.indent.pro +++ b/bacnet-stack/.indent.pro @@ -1 +1 @@ --kr -nut -nlp +-kr -nut -nlp -ip4 -cli4 diff --git a/bacnet-stack/indent.sh b/bacnet-stack/indent.sh index ec58d1ea..d1ec15ec 100755 --- a/bacnet-stack/indent.sh +++ b/bacnet-stack/indent.sh @@ -1,22 +1,30 @@ #!/bin/sh # indent uses a local indent.pro file if it exists -# echo "-kr -nut -nlp" > .indent.pro + +# exit silently if utility is not installed +[ -x /usr/bin/indent ] || exit 0 +[ -x /usr/bin/dos2unix ] || exit 0 + +if [ ! -x .indent.pro ] +then + echo "-kr -nut -nlp -ip4 -cli4" > .indent.pro +fi directory=${1-`pwd`} for filename in $( find $directory -name '*.c' ) do echo Fixing DOS/Unix $filename - dos2unix $filename + /usr/bin/dos2unix $filename echo Indenting $filename - indent -kr -nut -nlp $filename + /usr/bin/indent $filename done for filename in $( find $directory -name '*.h' ) do echo Fixing DOS/Unix $filename - dos2unix $filename + /usr/bin/dos2unix $filename echo Indenting $filename - indent -kr -nut -nlp $filename + /usr/bin/indent $filename done for filename in $( find $directory -name '*~' )