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 83a61cf

Browse filesBrowse files
jfsimonfabpot
authored andcommitted
fixed paths/notPaths regex for shell adapters
1 parent 32c5bf7 commit 83a61cf
Copy full SHA for 83a61cf

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Finder/Adapter/AbstractFindAdapter.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ private function buildPathsFiltering(Command $command, $dir, array $paths, $not
210210
// Fixes 'not search' regex problems.
211211
if ($expr->isRegex()) {
212212
$regex = $expr->getRegex();
213-
$regex->prepend($regex->hasStartFlag() ? '' : '.*')->setEndJoker(!$regex->hasEndFlag());
213+
$regex->prepend($regex->hasStartFlag() ? $dir.DIRECTORY_SEPARATOR : '.*')->setEndJoker(!$regex->hasEndFlag());
214214
} else {
215215
$expr->prepend('*')->append('*');
216216
}
@@ -221,7 +221,7 @@ private function buildPathsFiltering(Command $command, $dir, array $paths, $not
221221
? ($expr->isCaseSensitive() ? '-regex' : '-iregex')
222222
: ($expr->isCaseSensitive() ? '-path' : '-ipath')
223223
)
224-
->arg($expr->prepend($dir.DIRECTORY_SEPARATOR)->renderPattern());
224+
->arg($expr->renderPattern());
225225
}
226226

227227
$command->cmd(')');

0 commit comments

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