Skip to content

Commit

Permalink
Fix raw write for strings
Browse files Browse the repository at this point in the history
  • Loading branch information
monarchdodra committed Sep 19, 2013
1 parent ae2559d commit 4d482d3
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions std/format.d
Expand Up @@ -2156,10 +2156,20 @@ if (isInputRange!T)
}
else if (f.spec == 'r')
{
// raw writes
for (size_t i; !val.empty; val.popFront(), ++i)
static if (is(DynamicArrayTypeOf!T))
{
formatValue(w, val.front, f);
alias ARR = DynamicArrayTypeOf!T;
foreach (e ; cast(ARR)val)
{
formatValue(w, e, f);
}
}
else
{
for (size_t i; !val.empty; val.popFront(), ++i)
{
formatValue(w, val.front, f);
}
}
}
else if (f.spec == '(')
Expand Down

0 comments on commit 4d482d3

Please sign in to comment.