Re: Is this a bug in pg_current_logfile() on Windows?

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Cc: Thomas Kellerer <shammat@gmx.net>, pgsql-hackers@lists.postgresql.org
Date: 2020-07-09T15:24:43Z
Lists: pgsql-hackers, pgsql-general
Andrew Dunstan <andrew.dunstan@2ndquadrant.com> writes:
> On 7/9/20 11:04 AM, Tom Lane wrote:
>> Therefore, we either should figure out how to get msys perl to do
>> that conversion (and remove it from our code altogether), or make the
>> conversions conditional on "is it msys perl?".  I am not quite sure
>> if the existing tests "if $Config{osname} eq 'msys'" are a legitimate
>> implementation of that condition or not --- it seems like nominally
>> they are checking the OS not the Perl, but maybe it's close enough.

> If the reported OS is msys (it's a pseudo OS in effect) then the perl
> must be msys' perl. Even when called from msys, native perl reports the
> OS as MSWin32. So yes, close enough.

Cool, I'll go try changing all those conditions to use the msys test.

			regards, tom lane



Commits

  1. Tighten up Windows CRLF conversion in our TAP test scripts.

  2. Fix pg_current_logfile() to not emit a carriage return on Windows.

  3. Further tighten Windows CRLF conversion in our TAP test scripts.

  4. Add test coverage for pg_current_logfile() function.

  5. Fix failures to ignore \r when reading Windows-style newlines.

  6. Fix TAP infrastructure to support Mingw better