diff --git a/src/Composer/Autoload/AutoloadGenerator.php b/src/Composer/Autoload/AutoloadGenerator.php index 940ab3f18..2bb0c98b1 100644 --- a/src/Composer/Autoload/AutoloadGenerator.php +++ b/src/Composer/Autoload/AutoloadGenerator.php @@ -901,7 +901,7 @@ INITIALIZER; } $resolvedPath = realpath($installPath . '/' . $updir); - $autoloads[] = preg_quote(strtr($resolvedPath, '\\', '/')) . '/' . $path; + $autoloads[] = preg_quote(strtr($resolvedPath, '\\', '/')) . '/' . $path . '($|/)'; continue; } diff --git a/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php b/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php index ff81581d7..055b03e1c 100644 --- a/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php +++ b/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php @@ -1525,8 +1525,8 @@ EOF; '/composersrc/ClassToExclude.php', '/composersrc/*/excluded/excsubpath', '**/excsubpath', - 'composers', // should _not_ cause exclusion of /composersrc/** - '/src-ca/', // should _not_ cause exclusion of /src-cake/** + 'composers', // should _not_ cause exclusion of /composersrc/**, as it is equivalent to /composers/** + '/src-ca/', // should _not_ cause exclusion of /src-cake/**, as it is equivalent to /src-ca/** ), ));