Re: Refactoring code stripping trailing \n and \r from strings

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Bruce Momjian <bruce@momjian.us>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2019-08-07T01:10:36Z
Lists: pgsql-hackers
On Tue, Aug 06, 2019 at 03:10:33PM -0400, Bruce Momjian wrote:
> On Thu, Aug  1, 2019 at 12:18:20PM +0900, Michael Paquier wrote:
>> b654714 has reworked the way we handle removal of CLRF for several
>> code paths, and has repeated the same code patterns to do that in 8
>> different places.  Could it make sense to refactor things as per the
>> attached with a new routine in common/string.c?
> 
> Yes, I think this is a good idea.

Thanks for the review, Bruce!  Tom, do you have any objections?
--
Michael

Commits

  1. Refactor logic to remove trailing CR/LF characters from strings