Skip to content

Commit

Permalink
Fix Issue 19133 - core.exception.rangeerror@std/file.d(3812)
Browse files Browse the repository at this point in the history
  • Loading branch information
edi33416 committed Dec 14, 2018
1 parent 807afdc commit 394bab7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions std/file.d
Original file line number Diff line number Diff line change
Expand Up @@ -3861,8 +3861,16 @@ else version (Posix)
import std.path : buildPath;
import std.string : representation;

immutable len = fd.d_name[].representation.countUntil(0);
_name = buildPath(path, fd.d_name[0 .. len]);
version (Solaris)
{
immutable len = (() @trusted => cast(char*) fd + fd.d_reclen - &fd.d_name[0])();
_name = buildPath(path, (() @trusted => (&fd.d_name[0])[0 .. len])());
}
else
{
immutable len = fd.d_name[].representation.countUntil(0);
_name = buildPath(path, fd.d_name[0 .. len]);
}

_didLStat = false;
_didStat = false;
Expand Down

0 comments on commit 394bab7

Please sign in to comment.