Fix pgindent to not have blank line before #else in variable definition

section of a function.
This commit is contained in:
Bruce Momjian 2005-07-13 04:44:42 +00:00
parent 7690b41328
commit 5d0a43c585
1 changed files with 3 additions and 2 deletions

View File

@ -1648,14 +1648,15 @@ do
print line1;
}
}' |
# remove blank line before #endif
# remove blank line before #else and #endif
awk ' BEGIN {line1 = ""; line2 = ""; skips = 0}
{
line2 = $0;
if (skips > 0)
skips--;
if (line1 ~ /^$/ &&
line2 ~ /^#endif/)
(line2 ~ /^#else/ ||
line2 ~ /^#endif/))
{
print line2;
line2 = "";