From 91bdf499b37b0bbef34e2bab5cc40dde52bda52c Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 8 Jul 2020 20:25:52 -0400 Subject: Tighten up Windows CRLF conversion in our TAP test scripts. The previous approach was to search-and-destroy all \r occurrences no matter what. That seems more likely to hide bugs than anything else; indeed it seems to be hiding one now. Fix things so that we only transform \r\n to \n. Side effects: must do this before, not after, chomp'ing if we're going to chomp, else we'd fail to clean up a trailing \r\n. Also, remove safe_psql's redundant repetition of what psql already did; else it might reduce \r\r\n to \n, which is exactly the scenario I'm hoping to expose. Perhaps this should be back-patched, but for now I'm content to see what happens in HEAD. Discussion: https://postgr.es/m/412ae8da-76bb-640f-039a-f3513499e53d@gmx.net --- src/test/perl/TestLib.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/test/perl/TestLib.pm') diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm index d579d5c177b..a7490d2ce79 100644 --- a/src/test/perl/TestLib.pm +++ b/src/test/perl/TestLib.pm @@ -430,7 +430,7 @@ sub slurp_file CloseHandle($fHandle) or die "could not close \"$filename\": $^E\n"; } - $contents =~ s/\r//g if $Config{osname} eq 'msys'; + $contents =~ s/\r\n/\n/g if $Config{osname} eq 'msys'; return $contents; } -- cgit v1.2.3