mirror of
https://github.com/dlang/phobos.git
synced 2025-04-30 07:00:37 +03:00
Merge pull request #3690 from CyberShadow/pull-20151003-171210
fix Issue 15146 - std.file.dirEntries("") only works on Windows
This commit is contained in:
commit
32b51aed4f
1 changed files with 5 additions and 1 deletions
|
@ -3417,7 +3417,8 @@ private struct DirIteratorImpl
|
||||||
|
|
||||||
bool stepIn(string directory)
|
bool stepIn(string directory)
|
||||||
{
|
{
|
||||||
auto h = cenforce(opendir(directory.tempCString()), directory);
|
auto h = directory.length ? opendir(directory.tempCString()) : opendir(".");
|
||||||
|
cenforce(h, directory);
|
||||||
_stack.put(DirHandle(directory, h));
|
_stack.put(DirHandle(directory, h));
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
@ -3685,6 +3686,9 @@ unittest
|
||||||
// issue 11392
|
// issue 11392
|
||||||
auto dFiles = dirEntries(testdir, SpanMode.shallow);
|
auto dFiles = dirEntries(testdir, SpanMode.shallow);
|
||||||
foreach(d; dFiles){}
|
foreach(d; dFiles){}
|
||||||
|
|
||||||
|
// issue 15146
|
||||||
|
dirEntries("", SpanMode.shallow).walkLength();
|
||||||
}
|
}
|
||||||
|
|
||||||
/++
|
/++
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue