From: Bruce Momjian Date: Sat, 27 Oct 2001 03:31:36 +0000 (+0000) Subject: Correct fix for indenting. X-Git-Tag: REL7_2_BETA2~85 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5ef74fe5939ed4b33c177991d24b1dd9611cbca1;p=postgresql Correct fix for indenting. --- diff --git a/src/tools/pgindent/pgindent b/src/tools/pgindent/pgindent index d5e99913eb..614d93ae42 100755 --- a/src/tools/pgindent/pgindent +++ b/src/tools/pgindent/pgindent @@ -1,5 +1,11 @@ #!/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 entab /dev/null if [ "$?" -ne 0 ] @@ -38,14 +44,14 @@ do awk ' BEGIN {line1 = ""; line2 = ""} { line2 = $0; + if (NR >= 2) + print line1; if (NR >= 2 && line2 ~ "^{[ ]*$" && line1 !~ "^struct" && line1 !~ "^enum" && line1 !~ "^typedef") - printf "int pgindent_func_no_var_fix;"; - if (NR >= 2) - print line1; + print "int pgindent_func_no_var_fix;"; line1 = line2; } END {