Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3f9d2ed

Browse files
committed
Restore previous psql behavior of not printing useless trailing spaces
after the data in the last column on a line.
1 parent07bae9c commit3f9d2ed

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

‎src/bin/psql/print.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
55
*
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 $
77
*/
88
#include"postgres_fe.h"
99
#include"common.h"
@@ -573,11 +573,15 @@ print_aligned_text(const char *title, const char *const * headers,
573573
for (j=0;j<col_count;j++)
574574
{
575575
structlineptr*this_line=col_lineptrs[j]+line_count;
576+
boolfinalspaces= (opt_border==2||j!=col_count-1);
577+
576578
if (complete[j])/* Just print spaces... */
577-
fprintf(fout,"%*s",widths[j],"");
579+
{
580+
if (finalspaces)
581+
fprintf(fout,"%*s",widths[j],"");
582+
}
578583
else
579584
{
580-
581585
/* content */
582586
if (opt_align[j]=='r')
583587
{
@@ -602,7 +606,7 @@ print_aligned_text(const char *title, const char *const * headers,
602606
}
603607
else
604608
fprintf(fout,"%-s%*s",this_line->ptr,
605-
widths[j]-this_line->width,"");
609+
finalspaces ? (widths[j]-this_line->width) :0,"");
606610
/* If at the right height, done this col */
607611
if (line_count==heights[j]-1|| !this_line[1].ptr)
608612
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp