1
0
mirror of https://github.com/danog/file.git synced 2024-11-30 04:19:39 +01:00

Handle backslashes in paths correctly

This commit is contained in:
Niklas Keller 2017-06-17 23:51:29 +02:00
parent 1a46ea9b13
commit 0708ba14b3
3 changed files with 2 additions and 3 deletions

View File

@ -393,7 +393,7 @@ class EioDriver implements Driver {
$priority = \EIO_PRI_DEFAULT; $priority = \EIO_PRI_DEFAULT;
if ($recursive) { if ($recursive) {
$path = str_replace("/", DIRECTORY_SEPARATOR, $path); $path = str_replace(["/", "\\"], DIRECTORY_SEPARATOR, $path);
$arrayPath = explode(DIRECTORY_SEPARATOR, $path); $arrayPath = explode(DIRECTORY_SEPARATOR, $path);
$tmpPath = ""; $tmpPath = "";

View File

@ -351,7 +351,7 @@ class UvDriver implements Driver {
$deferred = new Deferred; $deferred = new Deferred;
if ($recursive) { if ($recursive) {
$path = str_replace("/", DIRECTORY_SEPARATOR, $path); $path = str_replace(["/", "\\"], DIRECTORY_SEPARATOR, $path);
$arrayPath = explode(DIRECTORY_SEPARATOR, $path); $arrayPath = explode(DIRECTORY_SEPARATOR, $path);
$tmpPath = ""; $tmpPath = "";

View File

@ -3,7 +3,6 @@
namespace Amp\File; namespace Amp\File;
use Amp\Loop; use Amp\Loop;
use Amp\Parallel\Worker\Worker;
use Amp\Promise; use Amp\Promise;
const LOOP_STATE_IDENTIFIER = Driver::class; const LOOP_STATE_IDENTIFIER = Driver::class;