From 80b9a0043967a3d609eed5770e464c05e98fcd73 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 25 Oct 2001 19:57:03 +0000 Subject: [PATCH] Add blank line before #endif to #endif's at the end of the file. --- HISTORY | 9 ++++++++- src/tools/pgindent/pgindent | 24 +++++++++++++++++------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/HISTORY b/HISTORY index f5b8cc660f..8565d4ccc8 100644 --- a/HISTORY +++ b/HISTORY @@ -66,6 +66,8 @@ Fix nested EXCEPT/INTERSECT (Tom) Python fix fetchone() (Gerhard Haring) ECPG fixes (Michael, Christof Petig) PL/PgSQL trailing semicolon optional (Tom) +Fix path_inter, path_distance, path_length, dist_ppath to handle closed + paths (Curtis Barrett, Tom) Enhancements ------------ @@ -138,6 +140,7 @@ New CREATE OR REPLACE FUNCTION that preserves function oid (Gavin Sherry) DROP AGGREGATE and COMMENT ON AGGREGATE now accept an aggtype (Tom) Prevent output of default index op class in pg_dump (Tom) Allow trailing semicolons in psql backslash commands (Greg Sabino Mullane) +Prompt for psql password from /dev/tty if possible Types ----- @@ -165,7 +168,10 @@ Modify type coersion logic to attempt binary-compatible functions first (Tom) Allow optional () after current_user, session_user, user, etc. (Peter E) Add compatibility functions to odbc.sql (Peter E) Force new password prompt when changing user and database in psql (Tatsuo, Tom) - +New /contrib/tsearch full text indexing (Oleg, Teodor Sigaev) +Allow better selectivity with Nan and infinities in NUMERIC (Tom) +Accept an INTERVAL argument for SET TIME ZONE (Thomas) +Implement INTERVAL() YEA Performance ----------- Optimizer improvements (Tom) @@ -225,6 +231,7 @@ ODBC ECPG EXECUTE ... INTO ... implemented multiple row descriptor support (e.g. CARDINALITY) + Fix for GRANT parameters (Lee Kindness) Source Code ----------- diff --git a/src/tools/pgindent/pgindent b/src/tools/pgindent/pgindent index d939c676bd..6f843944fd 100755 --- a/src/tools/pgindent/pgindent +++ b/src/tools/pgindent/pgindent @@ -1292,7 +1292,7 @@ int pgindent_func_no_var_fix;\ # pull in #endif comments sed 's;^#endif[ ][ ]*/\*;#endif /*;' | # add space after comments that start on tab stops - sed 's:\([;,)/]\)/\*.*\*/\)$:\1 \2:' | + sed 's:\([^ ]\)/\*.*\*/\)$:\1 \2:' | # work around #else indenting next line if #ifdef defines variables at top # work around misindenting of function with no variables defined awk ' @@ -1329,14 +1329,13 @@ int pgindent_func_no_var_fix;\ print line1; line1 = line2; line2 = line3; - line3 = ""; } END { if (skips <= 1) print line1; if (skips <= 2) print line2; - }' | + }' | # remove blank line between opening brace and block comment awk ' { @@ -1358,14 +1357,13 @@ int pgindent_func_no_var_fix;\ print line1; line1 = line2; line2 = line3; - line3 = ""; } END { if (skips <= 1) print line1; if (skips <= 2) print line2; - }' | + }' | # remove blank line before #endif awk ' BEGIN {line1 = ""; line2 = ""; skips = 0} { @@ -1383,12 +1381,24 @@ int pgindent_func_no_var_fix;\ if (skips == 0 && NR >= 2) print line1; line1 = line2; - line2 = ""; } END { if (skips <= 1) print line1; - }' | + }' | +# add blank line before #endif if it is the last line in the file + awk ' BEGIN {line1 = ""; line2 = ""} + { + line2 = $0; + if (NR >= 2) + print line1; + line1 = line2; + } + END { + if (line2 ~ "^#endif") + printf "\n"; + print line1; + }' | # Move prototype names to the same line as return type. Useful for ctags. # Indent should do this, but it does not. It formats prototypes just # like real functions. -- 2.40.0