]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
runtests: allow creating files without newlines
authorDaniel Stenberg <daniel@haxx.se>
Sun, 13 Sep 2020 21:23:44 +0000 (23:23 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 14 Sep 2020 06:32:45 +0000 (08:32 +0200)
Closes #5946

tests/runtests.pl

index 3985f7fde36e5ffb493ba6bd67262fba065805ef..7bfaab57a9ae3dc5e1f959b310ad8389d5489ad4 100755 (executable)
@@ -3753,6 +3753,10 @@ sub singletest {
             subVariables(\$fileContent);
             open(OUTFILE, ">$filename");
             binmode OUTFILE; # for crapage systems, use binary
+            if($fileattr{'nonewline'}) {
+                # cut off the final newline
+                chomp($fileContent);
+            }
             print OUTFILE $fileContent;
             close(OUTFILE);
         }