Content-Length: 274125 | pFad | https://github.com/postgrespro/postgres/commit/b90e6cef12662ccad8679be24cd650c6b49feb1c

86 In PQprint(), write HTML table trailer before closing the output pipe. · postgrespro/postgres@b90e6ce · GitHub
Skip to content

Commit b90e6ce

Browse files
committed
In PQprint(), write HTML table trailer before closing the output pipe.
This is an astonishingly ancient bit of silliness, dating AFAICS to commit edb519b of 27-Jul-1996 which added the pipe close stanza in the wrong place. It happens to be harmless given that the code above this won't enable the pager if html3 output mode is selected. Still, somebody might try to relax that restriction someday, and in any case it could confuse readers and static analysis tools, so let's fix it in HEAD. Per bug #15541 from Pan Bian. Discussion: https://postgr.es/m/15541-c835d8b9a903f7ad@postgresql.org
1 parent 5deadfe commit b90e6ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/interfaces/libpq/fe-print.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@ PQprint(FILE *fout, const PGresult *res, const PQprintOpt *po)
304304
if (po->header && !po->html3)
305305
fprintf(fout, "(%d row%s)\n\n", PQntuples(res),
306306
(PQntuples(res) == 1) ? "" : "s");
307+
if (po->html3 && !po->expanded)
308+
fputs("</table>\n", fout);
307309
free(fieldMax);
308310
free(fieldNotNum);
309311
free((void *) fieldNames);
@@ -323,8 +325,6 @@ PQprint(FILE *fout, const PGresult *res, const PQprintOpt *po)
323325
#endif /* ENABLE_THREAD_SAFETY */
324326
#endif /* WIN32 */
325327
}
326-
if (po->html3 && !po->expanded)
327-
fputs("</table>\n", fout);
328328
}
329329
}
330330

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/postgrespro/postgres/commit/b90e6cef12662ccad8679be24cd650c6b49feb1c

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy