From a92bbffbc3a7157b0998f0423cf2304c81626822 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Wed, 29 Oct 2025 09:55:48 +0900 Subject: [PATCH] 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 1c6d4629394d, msys perl being one case where the translation mattered. Note: An equivalent has been first applied on HEAD with 8767b449a3a1. The same change is backpatched to v18 as all the Windows buildfarm members have reported green. Author: Jacob Champion Co-authored-by: Michael Paquier Reviewed-by: Daniel Gustafsson Discussion: https://postgr.es/m/aPsh39bxwYKvUlAf@paquier.xyz Backpatch-through: 18 --- src/interfaces/libpq/t/006_service.pl | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/interfaces/libpq/t/006_service.pl b/src/interfaces/libpq/t/006_service.pl index 4fe5adc5c2a..3ccd9a06e63 100644 --- a/src/interfaces/libpq/t/006_service.pl +++ b/src/interfaces/libpq/t/006_service.pl @@ -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,