diff options
| author | Bruce Momjian <bruce@momjian.us> | 1999-07-15 22:40:16 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 1999-07-15 22:40:16 +0000 |
| commit | 2e6b1e63a3f4990594af94afe1b3cef90ae752b5 (patch) | |
| tree | bb72a1ec4e38514c726a73b1344971307c2db01e /src/tools/pginclude/pgnoinclude | |
| parent | 40a89e08b2d7bb592d940e56f696df4a6459e7a3 (diff) | |
| download | postgresql-2e6b1e63a3f4990594af94afe1b3cef90ae752b5.tar.gz | |
Remove unused #includes in *.c files.
Diffstat (limited to 'src/tools/pginclude/pgnoinclude')
| -rwxr-xr-x | src/tools/pginclude/pgnoinclude | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/tools/pginclude/pgnoinclude b/src/tools/pginclude/pgnoinclude index 5fbf553a11..35f191fa6a 100755 --- a/src/tools/pginclude/pgnoinclude +++ b/src/tools/pginclude/pgnoinclude @@ -36,8 +36,14 @@ do if [ "$?" -eq 0 ] then echo "$FILE $INCLUDE" if [ "$IS_INCLUDE" = "N" ] - then grep -v '^#include[ ][ ]*[<"]'"$INCLUDE"'[>"]' $FILE >/tmp/$$b + then grep -v '^#include[ ][ ]*[<"]'"$INCLUDE"'[>"]' "$FILE" >/tmp/$$b mv /tmp/$$b "$FILE" + # reload after #include removal + if [ "$IS_INCLUDE" = "Y" ] + then cat "$FILE" | grep -v "^#if" | grep -v "^#else" | + grep -v "^#endif" | sed 's/->[a-zA-Z0-9_\.]*//g' >/tmp/$$a + else cat "$FILE" >/tmp/$$a + fi fi if [ "$1" = "-v" ] then cat /tmp/$$ |
