From e27448b6b1207f93af22c75c58775d31713fb7d4 Mon Sep 17 00:00:00 2001 From: hakre Date: Sun, 28 Oct 2012 00:21:42 +0300 Subject: [PATCH] Normalize PHAR path on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Windows has a different DIRECTORY_SEPARATOR than PHP's `phar://` which   has `/`. Set it. This fix is broken on systems that have a DIRECTORY_SEPARATOR that is larger than one byte. No assertion for this edge-case. --- PHP/CodeCoverage/Report/Factory.php | 1 + 1 file changed, 1 insertion(+) diff --git a/PHP/CodeCoverage/Report/Factory.php b/PHP/CodeCoverage/Report/Factory.php index e69c457bb..948301514 100644 --- a/PHP/CodeCoverage/Report/Factory.php +++ b/PHP/CodeCoverage/Report/Factory.php @@ -231,6 +231,7 @@ protected function reducePaths(&$files) // strip phar:// prefixes if (strpos($paths[$i], 'phar://') === 0) { $paths[$i] = substr($paths[$i], 7); + $paths[$i] = strtr($paths[$i], '/', DIRECTORY_SEPARATOR); } $paths[$i] = explode(DIRECTORY_SEPARATOR, $paths[$i]);