浏览代码

Fixed filesystem issue on windows

Martin Hasoň 11 年之前
父节点
当前提交
9df65ee4c8
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      src/Composer/Util/Filesystem.php

+ 4 - 4
src/Composer/Util/Filesystem.php

@@ -223,11 +223,11 @@ class Filesystem
         }
         }
 
 
         $commonPath = $to;
         $commonPath = $to;
-        while (strpos($from.'/', $commonPath.'/') !== 0 && '/' !== $commonPath && !preg_match('{^[a-z]:/?$}i', $commonPath)) {
+        while (strpos($from.'/', $commonPath.'/') !== 0 && '/' !== $commonPath && !preg_match('{^[a-z]:/?$}i', $commonPath) && '.' !== $commonPath) {
             $commonPath = dirname($commonPath);
             $commonPath = dirname($commonPath);
         }
         }
 
 
-        if (0 !== strpos($from, $commonPath) || '/' === $commonPath) {
+        if (0 !== strpos($from, $commonPath) || '/' === $commonPath || '.' === $commonPath) {
             return $to;
             return $to;
         }
         }
 
 
@@ -261,11 +261,11 @@ class Filesystem
         }
         }
 
 
         $commonPath = $to;
         $commonPath = $to;
-        while (strpos($from.'/', $commonPath.'/') !== 0 && '/' !== $commonPath && !preg_match('{^[a-z]:/?$}i', $commonPath)) {
+        while (strpos($from.'/', $commonPath.'/') !== 0 && '/' !== $commonPath && !preg_match('{^[a-z]:/?$}i', $commonPath) && '.' !== $commonPath) {
             $commonPath = dirname($commonPath);
             $commonPath = dirname($commonPath);
         }
         }
 
 
-        if (0 !== strpos($from, $commonPath) || '/' === $commonPath) {
+        if (0 !== strpos($from, $commonPath) || '/' === $commonPath || '.' === $commonPath) {
             return var_export($to, true);
             return var_export($to, true);
         }
         }