From 6f23c198cea86ff7a0cbcc6970a11593f8b06f2f Mon Sep 17 00:00:00 2001 From: Benjamin Chodoroff Date: Wed, 7 Oct 2015 14:53:14 -0400 Subject: [PATCH 1/2] skip windows drives fixes derhasi/composer-preserve-paths#1 --- src/PathPreserver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PathPreserver.php b/src/PathPreserver.php index 21f6680..030dcf2 100644 --- a/src/PathPreserver.php +++ b/src/PathPreserver.php @@ -231,7 +231,7 @@ static public function file_exists($path) { $reset_perms = array(); $folder = $path; while ($folder = dirname($folder)) { - if ($folder === '.' || $folder === '/') { + if ($folder === '.' || $folder === '/' || strpos($folder, ':\\')) { break; } elseif ($folder === '') { From b364a919340b9bc483844ff6ff0ba469632818a3 Mon Sep 17 00:00:00 2001 From: Benjamin Chodoroff Date: Wed, 7 Oct 2015 15:46:28 -0400 Subject: [PATCH 2/2] a better test --- src/PathPreserver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PathPreserver.php b/src/PathPreserver.php index 030dcf2..2164057 100644 --- a/src/PathPreserver.php +++ b/src/PathPreserver.php @@ -231,7 +231,7 @@ static public function file_exists($path) { $reset_perms = array(); $folder = $path; while ($folder = dirname($folder)) { - if ($folder === '.' || $folder === '/' || strpos($folder, ':\\')) { + if ($folder === '.' || $folder === '/' || preg_match("/^.:\\\\$/", $folder)) { break; } elseif ($folder === '') {