]> granicus.if.org Git - postgresql/commit
Fix indentation of \d footers for non-ASCII cases.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 8 Mar 2012 00:25:59 +0000 (19:25 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 8 Mar 2012 00:25:59 +0000 (19:25 -0500)
commit1ed7f0e6b90a9b693895105a90d8b5b0eefbcd56
tree91069fbf179350e89383fba0a4bc2bcb096cf90a
parent9088d1b96504717fd589ff7eeacc96b6d1c08ead
Fix indentation of \d footers for non-ASCII cases.

Multi-line "Inherits:" and "Child tables:" footers were misindented when
those strings' translations involved multibyte characters, because we were
using strlen() instead of an appropriate display width measurement.

In passing, avoid doing gettext() more than once per loop in these places.

While at it, fix pg_wcswidth(), which has been entirely broken since about
8.2, but fortunately has been unused for the same length of time.

Report and patch by Sergey Burladyan (bug #6480)
src/bin/psql/describe.c
src/bin/psql/mbprint.c
src/bin/psql/mbprint.h