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

Commit1597e6c

Browse files
committed
Handle border = 3 in expanded mode
In psql, expanded mode was not being displayed correctly when usingthe normal ascii or unicode linestyles and border set to '3'. Now,per the documentation, border '3' is really only sensible for HTMLand LaTeX formats, however, that's no excuse for ascii/unicode tobreak in that case, and provisions had been made for psql to cleanlyhandle this case (and it did, in non-expanded mode).This was broken when ascii/unicode was initially added a good fiveyears ago because print_aligned_vertical_line wasn't passed in theborder setting being used by print_aligned_vertical but instead wasgiven the whole printTableContent. There really isn't a good reasonfor vertical_line to have the entire printTableContent structure, sojust pass in the printTextFormat and border setting (similar to howthis is handled in horizontal_line).Pointed out by Pavel Stehule, fix by me.Back-patch to all currently-supported versions.
1 parent7dfab04 commit1597e6c

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

‎src/bin/psql/print.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,16 +1085,15 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
10851085

10861086

10871087
staticvoid
1088-
print_aligned_vertical_line(constprintTableContent*cont,
1088+
print_aligned_vertical_line(constprintTextFormat*format,
1089+
constunsigned shortopt_border,
10891090
unsigned longrecord,
10901091
unsignedinthwidth,
10911092
unsignedintdwidth,
10921093
printTextRulepos,
10931094
FILE*fout)
10941095
{
1095-
constprintTextFormat*format=get_line_style(cont->opt);
10961096
constprintTextLineFormat*lformat=&format->lrule[pos];
1097-
unsigned shortopt_border=cont->opt->border;
10981097
unsignedinti;
10991098
intreclen=0;
11001099

@@ -1255,11 +1254,11 @@ print_aligned_vertical(const printTableContent *cont, FILE *fout)
12551254
if (i %cont->ncolumns==0)
12561255
{
12571256
if (!opt_tuples_only)
1258-
print_aligned_vertical_line(cont,record++,hwidth,dwidth,
1259-
pos,fout);
1257+
print_aligned_vertical_line(format,opt_border,record++,
1258+
hwidth,dwidth,pos,fout);
12601259
elseif (i!=0|| !cont->opt->start_table||opt_border==2)
1261-
print_aligned_vertical_line(cont,0,hwidth,dwidth,
1262-
pos,fout);
1260+
print_aligned_vertical_line(format,opt_border,0,hwidth,
1261+
dwidth,pos,fout);
12631262
}
12641263

12651264
/* Format the header */
@@ -1318,7 +1317,7 @@ print_aligned_vertical(const printTableContent *cont, FILE *fout)
13181317
if (cont->opt->stop_table)
13191318
{
13201319
if (opt_border==2&& !cancel_pressed)
1321-
print_aligned_vertical_line(cont,0,hwidth,dwidth,
1320+
print_aligned_vertical_line(format,opt_border,0,hwidth,dwidth,
13221321
PRINT_RULE_BOTTOM,fout);
13231322

13241323
/* print footers */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp