Prechádzať zdrojové kódy

Tentative fix for *nix

Jordi Boggiano 13 rokov pred
rodič
commit
a19695cdcb

+ 3 - 3
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;
         }