Skip to content

Commit

Permalink
Merge pull request #1749 from dawgfoto/fix11691
Browse files Browse the repository at this point in the history
fix Issue 11691 - can't join pathSplitter with pathSeparator
  • Loading branch information
monarchdodra committed Dec 5, 2013
2 parents 7b2c1aa + c125143 commit 4d3a2c4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions std/path.d
Original file line number Diff line number Diff line change
Expand Up @@ -1544,9 +1544,9 @@ auto pathSplitter(C)(const(C)[] path) @safe pure nothrow
static struct PathSplitter
{
@safe pure nothrow:
@property empty() const { return _empty; }
@property bool empty() const { return _empty; }

@property front() const
@property const(C)[] front() const
{
assert (!empty, "PathSplitter: called front() on empty range");
return _front;
Expand Down Expand Up @@ -1577,7 +1577,7 @@ auto pathSplitter(C)(const(C)[] path) @safe pure nothrow
}
}

@property back() const
@property const(C)[] back() const
{
assert (!empty, "PathSplitter: called back() on empty range");
return _back;
Expand Down Expand Up @@ -1730,6 +1730,10 @@ unittest
{
assert (equal(pathSplitter("/foo/bar".dup), ["/", "foo", "bar"]));
});

// Bugzilla 11691
// front should return a mutable array of const elements
static assert(is(typeof(pathSplitter!char(null).front) == const(char)[]));
}


Expand Down

0 comments on commit 4d3a2c4

Please sign in to comment.