pgsql: Clean up password prompting logic in streamutil.c.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Clean up password prompting logic in streamutil.c.
Date: 2013-11-15 22:27:51
Message-ID: E1VhRrj-0004oa-Hb@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Clean up password prompting logic in streamutil.c.

The previous coding was fairly unreadable and drew double-free warnings
from clang. I believe the double free was actually not reachable, because
PQconnectionNeedsPassword is coded to not return true if a password was
provided, so that the loop can't iterate more than twice. Nonetheless
it seems worth rewriting. No back-patch since this is just cosmetic.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/3172eea062e779db39df9a48fca0ad7448163f98

Modified Files
--------------
src/bin/pg_basebackup/streamutil.c | 110 ++++++++++++++++++------------------
1 file changed, 56 insertions(+), 54 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2013-11-15 23:02:12 pgsql: Speed up printing of INSERT statements in pg_dump.
Previous Message Tom Lane 2013-11-15 21:46:47 pgsql: Compute correct em_nullable_relids in get_eclass_for_sort_expr()