Re: [PATCH] - Provide robust alternatives for replace_string

From: Asim Praveen <pasim(at)vmware(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Georgios <gkokolatos(at)protonmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] - Provide robust alternatives for replace_string
Date: 2020-08-07 06:02:58
Message-ID: 367C3AB6-2A17-49C0-93F4-DB125C3397A7@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 05-Aug-2020, at 7:01 PM, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:
>
> On 2020-Aug-05, Asim Praveen wrote:
>
>> Please find attached a StringInfo based solution to this problem. It
>> uses fgetln instead of fgets such that a line is read in full, without
>> ever splitting it.
>
> never heard of fgetln, my system doesn't have a manpage for it, and we
> don't use it anywhere AFAICS. Are you planning to add something to
> src/common for it?
>

Indeed! I noticed fgetln on the man page of fgets and used it without checking. And this happened on a MacOS system.

Please find a revised version that uses fgetc instead.

Asim

Attachment Content-Type Size
v2-0001-Use-a-stringInfo-instead-of-a-char-for-replace_st.patch application/octet-stream 3.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2020-08-07 06:16:19 Switch to multi-inserts for pg_depend
Previous Message Andrey M. Borodin 2020-08-07 05:59:26 Re: Amcheck: do rightlink verification with lock coupling