> On Wed, Feb 27, 2019 at 1:32 PM Alvaro Herrera <alvhe...@2ndquadrant.com> > wrote: > > > > I think it would be better to just put back the .defn = "" (etc) to the > > > ArchiveEntry calls. > > > > Then we should do this not only for defn, but for owner and dropStmt too. > > Yeah, absolutely.
Done, please find the attached patch. > > I can > > update the fix patch I've sent before, if it's preferrable approach in this > > particular situation. > > I'm not sure we need those changes, since we're forced to update all > callsites anyway. I guess we can keep the part about removing null checks before using strlen, since it's going to be useless. > On Wed, Feb 27, 2019 at 10:36 AM Dmitry Dolgov <9erthali...@gmail.com> wrote: > > > On Tue, Feb 26, 2019 at 11:53 PM Alvaro Herrera <alvhe...@2ndquadrant.com> > > wrote: > > > > On 2019-Feb-26, Dmitry Dolgov wrote: > > > > > Yes, it should be rather simple, we can e.g. return to the old less > > > consistent > > > NULL handling approach something (like in the attached patch), or replace > > > a NULL > > > value with an empty string in WriteToc. Give me a moment, I'll check it > > > out. At > > > the same time I would suggest to keep replace_line_endings -> > > > sanitize_line, > > > since it doesn't break compatibility. > > > > Hmm, shouldn't we modify sanitize_line so that it returns strdup(hyphen) > > when input is empty and want_hyphen, too? > > Yes, you're right. I've looked closer, and looks like I was mistaken. In the only place where it matters we anyway pass NULL after verifying noOwner: sanitized_owner = sanitize_line(ropt->noOwner ? NULL : te->owner, true); So I haven't change sanitize_line yet, but can update it if there is a strong opinion about this function.
0001-ArchiveEntry-null-handling.patch
Description: Binary data