55#
66# On 09/06/1997, from the top directory, I ran:
77#
8- # find . -name '*.[ch]' -type f -print | grep -v '++' | xargs -n100PGINDENT
8+ # find . -name '*.[ch]' -type f -print | grep -v '++' | xargs -n100pgindent
99#
1010# The stock BSD indent has two bugs. First, a comment after the word 'else'
1111# causes the rest of the file to be ignored. Second, it silently ignores
12- # typedesf after getting the first 100.
12+ # typedefs after getting the first 100.
13+ #
1314# Both problems are worked-around in this script.
15+ # We also include a patch for the second bug in:
16+ # /src/tools/pgindent/indent.bsd.patch
17+ # Even with the workaround, installation of the patch produces better output.
18+ #
19+ # GNU indent has many bugs, and it not recommended. See the description
20+ # below.
21+ #
22+ # We get the list of typedef's from /src/tools/find_typedef
1423#
1524
1625trap " rm -f /tmp/$$ /tmp/$$ a" 0 1 2 3 15
@@ -27,7 +36,7 @@ thenecho "You do not appear to have 'indent' installed on your system." >&2
2736exit 1
2837fi
2938indent -version -npro< /dev/null> /dev/null2>&1
30- if [" $? " -ne 0 ]
39+ if [" $? " -eq 0 ]
3140then echo " You appear to have GNU indent rather than BSD indent." >&2
3241echo " Be warned, it has some small bugs, GNU indent version 1.9.1." >&2
3342echo " These bugs become pretty major when you are doing >200k lines of code." >&2
4857\2;g' | # workaround for indent bug
4958detab -t4 -qc|
5059sed' s;^DATA(.*$;/*&*/;' > /tmp/$$ a# protect backslashes in DATA()
60+
61+ # We get the list of typedef's from /src/tools/find_typedef
5162indent -bad -bap -bc -bl -d0 -cdb -nce -nfc1 -di12 -i4 -l75 \
5263-lp -nip -npro$EXTRA_OPTS \
5364-TA_Const \