mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Correct fix for indenting.
This commit is contained in:
@ -1,5 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Known bugs:
|
||||||
|
#
|
||||||
|
# Blank line is added after, seen as a function definition, no space
|
||||||
|
# after *:
|
||||||
|
# y = (int) x *y;
|
||||||
|
|
||||||
trap "rm -f /tmp/$$ /tmp/$$a" 0 1 2 3 15
|
trap "rm -f /tmp/$$ /tmp/$$a" 0 1 2 3 15
|
||||||
entab </dev/null >/dev/null
|
entab </dev/null >/dev/null
|
||||||
if [ "$?" -ne 0 ]
|
if [ "$?" -ne 0 ]
|
||||||
@ -38,14 +44,14 @@ do
|
|||||||
awk ' BEGIN {line1 = ""; line2 = ""}
|
awk ' BEGIN {line1 = ""; line2 = ""}
|
||||||
{
|
{
|
||||||
line2 = $0;
|
line2 = $0;
|
||||||
|
if (NR >= 2)
|
||||||
|
print line1;
|
||||||
if (NR >= 2 &&
|
if (NR >= 2 &&
|
||||||
line2 ~ "^{[ ]*$" &&
|
line2 ~ "^{[ ]*$" &&
|
||||||
line1 !~ "^struct" &&
|
line1 !~ "^struct" &&
|
||||||
line1 !~ "^enum" &&
|
line1 !~ "^enum" &&
|
||||||
line1 !~ "^typedef")
|
line1 !~ "^typedef")
|
||||||
printf "int pgindent_func_no_var_fix;";
|
print "int pgindent_func_no_var_fix;";
|
||||||
if (NR >= 2)
|
|
||||||
print line1;
|
|
||||||
line1 = line2;
|
line1 = line2;
|
||||||
}
|
}
|
||||||
END {
|
END {
|
||||||
|
Reference in New Issue
Block a user