Fix a few errors in comments. Patch by Fujii Masao, plus the one in
[PostgreSQL.git] / src / tools / pginclude / pgfixinclude
blobf9aaf7a6862a8f4a5ebe48a435aa3c3f9034ff32
2 # change #include's to <> or ""
3 # $PostgreSQL$
5 trap "rm -f /tmp/$$.c /tmp/$$.o /tmp/$$ /tmp/$$a /tmp/$$b" 0 1 2 3 15
6 find . \( -name CVS -a -prune \) -o -type f -name '*.[chyls]' -print |
7 while read FILE
8 do
9         cat "$FILE" | grep "^#include" |
10         sed 's/^#include[       ]*[<"]\([^>"]*\).*$/\1/g' |
11         while read INCLUDE
12         do
13                 if [ -s /usr/include/"$INCLUDE" ]
14                 then    cat "$FILE" |
15                         sed 's;^#include[       ][      ]*[<"]'"$INCLUDE"'[>"]$;#include <'"$INCLUDE"'>;g' >/tmp/$$
16                 else    cat "$FILE" |
17                         sed 's;^#include[       ][      ]*[<"]'"$INCLUDE"'[>"]$;#include "'"$INCLUDE"'";g' >/tmp/$$
18                 fi
19                 cat /tmp/$$ > "$FILE"
20         done
21 done