diff --git a/run-tests.php b/run-tests.php index 4ab74edbe6c..48a827298e0 100755 --- a/run-tests.php +++ b/run-tests.php @@ -1,5 +1,6 @@ #!/usr/bin/php 1) { echo '$Revision$' . "\n"; exit(1); default: - echo "Illegal switch specified!\n"; - //break + echo "Illegal switch '$switch' specified!\n"; case 'h': case '-help': case '--help': @@ -900,12 +900,12 @@ function save_text($filename, $text, $filename_copy = null) global $DETAILED; if ($filename_copy && $filename_copy != $filename) { - if (@file_put_contents($filename_copy, $text) === false) { + if (@file_put_contents($filename_copy, $text, FILE_BINARY) === false) { error("Cannot open file '" . $filename_copy . "' (save_text)"); } } - if (@file_put_contents($filename, $text) === false) { + if (@file_put_contents($filename, $text, FILE_BINARY) === false) { error("Cannot open file '" . $filename . "' (save_text)"); } @@ -1725,7 +1725,7 @@ COMMAND $cmd $wanted = trim($section_text['EXPECT']); - if (is_binary($wanted)) { + if (is_binary($output)) { $wanted = preg_replace(b'/\r\n/', b"\n", (binary)$wanted); } else { $wanted = preg_replace('/\r\n/', "\n", $wanted);