1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-03 09:13:20 +03:00

Simplify newline handling in libpq TAP test

CRLF translation is already handled by the text mode, so there should be
no need for any specific logic.  See also 1c6d462939, msys perl being
one case where the translation mattered.

Note: An equivalent has been first applied on HEAD with 8767b449a3.
The same change is backpatched to v18 as all the Windows buildfarm
members have reported green.

Author: Jacob Champion <jacob.champion@enterprisedb.com>
Co-authored-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://postgr.es/m/aPsh39bxwYKvUlAf@paquier.xyz
Backpatch-through: 18
This commit is contained in:
Michael Paquier
2025-10-29 09:55:48 +09:00
parent 74197bdc84
commit a92bbffbc3

View File

@@ -22,18 +22,14 @@ $dummy_node->init;
my $td = PostgreSQL::Test::Utils::tempdir;
# Windows vs non-Windows: CRLF vs LF for the file's newline, relying on
# the fact that libpq uses fgets() when reading the lines of a service file.
my $newline = $windows_os ? "\r\n" : "\n";
# Create the set of service files used in the tests.
# File that includes a valid service name, and uses a decomposed connection
# string for its contents, split on spaces.
my $srvfile_valid = "$td/pg_service_valid.conf";
append_to_file($srvfile_valid, "[my_srv]" . $newline);
append_to_file($srvfile_valid, "[my_srv]\n");
foreach my $param (split(/\s+/, $node->connstr))
{
append_to_file($srvfile_valid, $param . $newline);
append_to_file($srvfile_valid, $param . "\n");
}
# File defined with no contents, used as default value for PGSERVICEFILE,