Skip to content

Commit 2287b87

Browse files
committed
Further adjustment to psql's print_aligned_vertical() function.
We should ignore output_columns unless it's greater than zero. A zero means we couldn't get any information from ioctl(TIOCGWINSZ); in that case the expected behavior is to print the data at native width, not to wrap it at the smallest possible value. print_aligned_text() gets this consideration right, but print_aligned_vertical() lost track of this detail somewhere along the line.
1 parent e50cda7 commit 2287b87

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bin/psql/print.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,8 @@ print_aligned_vertical(const printTableContent *cont, FILE *fout)
14241424
if (rwidth > min_width)
14251425
min_width = rwidth;
14261426

1427-
if (width < min_width || output_columns < min_width)
1427+
if (width < min_width ||
1428+
(output_columns > 0 && output_columns < min_width))
14281429
{
14291430
/* Set data width to match min_width */
14301431
newdwidth = min_width - hwidth - swidth;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy