Commit 56bdbe1f authored by Bruce Momjian's avatar Bruce Momjian

Add remove extra braces code to pgindent.

parent 6bd323c6
...@@ -797,6 +797,32 @@ do ...@@ -797,6 +797,32 @@ do
detab -t8 -qc | detab -t8 -qc |
entab -t4 -qc | entab -t4 -qc |
sed 's;^\([A-Za-z_][^ ]*\)[ ][ ]*\*$;\1 *;' | # move trailing * in function return type sed 's;^\([A-Za-z_][^ ]*\)[ ][ ]*\*$;\1 *;' | # move trailing * in function return type
awk ' { line3 = $0; /* remove un-needed braces around single statements */
if (skips > 0)
skips--;
if (line1 ~ " *{$" &&
line2 ~ " *[^;{}]*;$" &&
line3 ~ " *}$")
{
print line2;
line1 = "";
line2 = "";
line3 = "";
skips = 3;
}
else
if (skips == 0 && NR >= 3)
print line1;
line1 = line2;
line2 = line3;
line3 = "";
}
END {
if (skips <= 1)
print line1;
if (skips <= 2)
print line2;
}' |
cat >/tmp/$$ && cat /tmp/$$ >$FILE cat >/tmp/$$ && cat /tmp/$$ >$FILE
done done
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment