pgsql: Refactor logic to remove trailing CR/LF characters from strings

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Refactor logic to remove trailing CR/LF characters from strings
Date: 2019-08-09 02:12:16
Message-ID: E1hvuO8-0000lN-DN@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Refactor logic to remove trailing CR/LF characters from strings

b654714 has reworked the way trailing CR/LF characters are removed from
strings. This commit introduces a new routine in common/string.c and
refactors the code so as the logic is in a single place, mostly.

Author: Michael Paquier
Reviewed-by: Bruce Momjian
Discussion: https://postgr.es/m/20190801031820.GF29334@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b8f2da0ac5a24f669c8d320c58646759b8fc69a5

Modified Files
--------------
src/backend/libpq/be-secure-common.c | 8 +++-----
src/bin/pg_ctl/pg_ctl.c | 10 +++-------
src/bin/pg_resetwal/pg_resetwal.c | 10 +++-------
src/bin/pg_upgrade/option.c | 20 +++++---------------
src/bin/psql/prompt.c | 10 +++++-----
src/common/string.c | 22 ++++++++++++++++++++++
src/include/common/string.h | 1 +
src/interfaces/libpq/fe-connect.c | 9 +++------
8 files changed, 45 insertions(+), 45 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2019-08-09 16:33:49 pgsql: Cosmetic improvements in setup of planner's per-RTE arrays.
Previous Message Peter Geoghegan 2019-08-08 20:20:59 pgsql: Update obsolete tuplesort READTUP() comment.