aboutsummaryrefslogtreecommitdiff
path: root/src/backend/nodes/print.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/nodes/print.c')
-rw-r--r--src/backend/nodes/print.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/backend/nodes/print.c b/src/backend/nodes/print.c
index 074a8389023..14f73b1860e 100644
--- a/src/backend/nodes/print.c
+++ b/src/backend/nodes/print.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/nodes/print.c,v 1.65 2003/11/29 19:51:49 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/nodes/print.c,v 1.66 2004/05/08 21:21:18 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -194,12 +194,20 @@ pretty_format_node_dump(const char *dump)
}
j = indentDist - 1;
/* j will equal indentDist on next loop iteration */
+ /* suppress whitespace just after } */
+ while (dump[i+1] == ' ')
+ i++;
break;
case ')':
- /* force line break after ')' */
- line[j + 1] = '\0';
- appendStringInfo(&str, "%s\n", line);
- j = indentDist - 1;
+ /* force line break after ), unless another ) follows */
+ if (dump[i+1] != ')')
+ {
+ line[j + 1] = '\0';
+ appendStringInfo(&str, "%s\n", line);
+ j = indentDist - 1;
+ while (dump[i+1] == ' ')
+ i++;
+ }
break;
case '{':
/* force line break before { */