tests: replace hard-coded /dev/null with variable

- add variable for the null device filename and use that in Perl code.
- initialize this variable with `NUL` on native Windows.
- add `%DEV_NULL` variable and use it in tests.

Fixes `The system cannot find the path specified.` messages seen when
running `runtests.pl` with native Windows Perl.

Also adjust code to not break mcedit syntax highlighting.

Cherry-picked from #14949
Closes #15098
This commit is contained in:
Viktor Szakats 2024-10-01 00:41:43 +02:00
parent 31a29fc6bd
commit 68c358619f
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
11 changed files with 25 additions and 15 deletions

View file

@ -110,7 +110,7 @@ sub parseprotocols {
# Initialize @protocols from the curl binary under test
#
sub init_protocols {
for (`$CURL -V 2>/dev/null`) {
for (`$CURL -V 2>$dev_null`) {
if(m/^Protocols: (.*)$/) {
parseprotocols($1);
}