Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9e43103

Browse filesBrowse files
chr-hertelfabpot
authored andcommitted
fix unix root dir issue
1 parent f20b36e commit 9e43103
Copy full SHA for 9e43103

File tree

Expand file treeCollapse file tree

2 files changed

+9
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+9
-1
lines changed

‎src/Symfony/Component/Finder/Finder.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Finder/Finder.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,10 @@ private function searchInDirectory($dir)
744744
*/
745745
private function normalizeDir($dir)
746746
{
747+
if ('/' === $dir) {
748+
return $dir;
749+
}
750+
747751
$dir = rtrim($dir, '/'.\DIRECTORY_SEPARATOR);
748752

749753
if (preg_match('#^(ssh2\.)?s?ftp://#', $dir)) {

‎src/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ public function current()
7474
}
7575
$subPathname .= $this->getFilename();
7676

77-
return new SplFileInfo($this->rootPath.$this->directorySeparator.$subPathname, $this->subPath, $subPathname);
77+
if ('/' !== $basePath = $this->rootPath) {
78+
$basePath .= $this->directorySeparator;
79+
}
80+
81+
return new SplFileInfo($basePath.$subPathname, $this->subPath, $subPathname);
7882
}
7983

8084
/**

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.