Skip to content

Commit

Permalink
Merge pull request #1873 from lionello/bug4483
Browse files Browse the repository at this point in the history
Preparation for issue 4483, specifying foreach char iteration type
  • Loading branch information
yebblies committed Jul 16, 2014
2 parents 8e9a7fe + eca3a10 commit e3cdb41
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions std/process.d
Expand Up @@ -2420,7 +2420,7 @@ private char[] escapeWindowsArgumentImpl(alias allocator)(in char[] arg)
// backslash for each escaped character.
size_t size = 1 + arg.length + 1;

foreach_reverse (c; arg)
foreach_reverse (char c; arg)
{
if (c == '"')
{
Expand All @@ -2443,7 +2443,7 @@ private char[] escapeWindowsArgumentImpl(alias allocator)(in char[] arg)
size_t p = size;
buf[--p] = '"';
escaping = true;
foreach_reverse (c; arg)
foreach_reverse (char c; arg)
{
if (c == '"')
escaping = true;
Expand Down Expand Up @@ -2525,14 +2525,14 @@ private char[] escapePosixArgumentImpl(alias allocator)(in char[] arg)
// return `'` ~ std.array.replace(arg, `'`, `'\''`) ~ `'`;

size_t size = 1 + arg.length + 1;
foreach (c; arg)
foreach (char c; arg)
if (c == '\'')
size += 3;

auto buf = allocator(size);
size_t p = 0;
buf[p++] = '\'';
foreach (c; arg)
foreach (char c; arg)
if (c == '\'')
{
buf[p..p+4] = `'\''`;
Expand Down

0 comments on commit e3cdb41

Please sign in to comment.