]> granicus.if.org Git - postgresql/commitdiff
Adjust NR tests. More accurate.
authorBruce Momjian <bruce@momjian.us>
Fri, 26 Oct 2001 17:54:45 +0000 (17:54 +0000)
committerBruce Momjian <bruce@momjian.us>
Fri, 26 Oct 2001 17:54:45 +0000 (17:54 +0000)
src/tools/pgindent/pgindent

index 15f30e6a30f844dca997d6755ec95fb1391e4343..d5e99913ebcf47ec0dfea6144eeeab2f6ea72ce3 100755 (executable)
@@ -1492,9 +1492,9 @@ do
                        line2 = line3;
                }
                END {
-                       if (NR > 1 && skips <= 1)
+                       if (NR >= 2 && skips <= 1)
                                print line1;
-                       if (NR > 2 && skips <= 2)
+                       if (NR >= 1 && skips <= 2)
                                print line2;
                }' |
 # remove blank line between opening brace and block comment
@@ -1520,9 +1520,9 @@ do
                        line2 = line3;
                }
                END {
-                       if (NR > 1 && skips <= 1)
+                       if (NR >= 2 && skips <= 1)
                                print line1;
-                       if (NR > 2 && skips <= 2)
+                       if (NR >= 1 && skips <= 2)
                                print line2;
                }' |
 # remove blank line before #endif
@@ -1544,7 +1544,7 @@ do
                        line1 = line2;
                }
                END {
-                       if (NR > 1 && skips <= 1)
+                       if (NR >= 1 && skips <= 1)
                                print line1;
                }' |
 # add blank line before #endif if it is the last line in the file
@@ -1556,7 +1556,7 @@ do
                        line1 = line2;
                }
                END {
-                       if (NR > 1 && line2 ~ "^#endif")
+                       if (NR >= 1 && line2 ~ "^#endif")
                                printf "\n";
                        print line1;
                }' |