From a19695cdcbcc20b96db86749fe26272a3d6706c8 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sun, 4 Dec 2011 18:44:40 +0100 Subject: [PATCH] Tentative fix for *nix --- src/Composer/Downloader/Util/Filesystem.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Composer/Downloader/Util/Filesystem.php b/src/Composer/Downloader/Util/Filesystem.php index bd8a346af..e20296b51 100644 --- a/src/Composer/Downloader/Util/Filesystem.php +++ b/src/Composer/Downloader/Util/Filesystem.php @@ -61,12 +61,12 @@ class Filesystem $from = rtrim(strtr($from, '\\', '/'), '/'); $to = rtrim(strtr($to, '\\', '/'), '/'); - $commonPath = dirname($to); - while (strpos($from, $commonPath) !== 0 && '/' !== $commonPath && !preg_match('{^[a-z]:/$}i', $commonPath)) { + $commonPath = strtr(dirname($to), '\\', '/'); + while (strpos($from, $commonPath) !== 0 && '/' !== $commonPath && !preg_match('{^[a-z]:/?$}i', $commonPath) && '.' !== $commonPath) { $commonPath = strtr(dirname($commonPath), '\\', '/'); } - if (0 !== strpos($from, $commonPath) || '/' === $commonPath) { + if (0 !== strpos($from, $commonPath) || '/' === $commonPath || '.' === $commonPath) { return $to; }