3
3
*
4
4
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
5
5
*
6
- * $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.82 2006/02/10 22:29:06 tgl Exp $
6
+ * $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.83 2006/02/12 02:56:21 tgl Exp $
7
7
*/
8
8
#include "postgres_fe.h"
9
9
#include "common.h"
@@ -573,11 +573,15 @@ print_aligned_text(const char *title, const char *const * headers,
573
573
for (j = 0 ; j < col_count ; j ++ )
574
574
{
575
575
struct lineptr * this_line = col_lineptrs [j ] + line_count ;
576
+ bool finalspaces = (opt_border == 2 || j != col_count - 1 );
577
+
576
578
if (complete [j ]) /* Just print spaces... */
577
- fprintf (fout , "%*s" , widths [j ], "" );
579
+ {
580
+ if (finalspaces )
581
+ fprintf (fout , "%*s" , widths [j ], "" );
582
+ }
578
583
else
579
584
{
580
-
581
585
/* content */
582
586
if (opt_align [j ] == 'r' )
583
587
{
@@ -602,7 +606,7 @@ print_aligned_text(const char *title, const char *const * headers,
602
606
}
603
607
else
604
608
fprintf (fout , "%-s%*s" , this_line -> ptr ,
605
- widths [j ] - this_line -> width , "" );
609
+ finalspaces ? ( widths [j ] - this_line -> width ) : 0 , "" );
606
610
/* If at the right height, done this col */
607
611
if (line_count == heights [j ]- 1 || !this_line [1 ].ptr )
608
612
{
0 commit comments