D-Programming-Language/dmd — pull request #1208 by AndrejMitrovic (2012-10-23 01:34:06+00:00)
Title: Fix Issue 8733 - Normalize -of and -od path on Windows

This fixes: http://d.puremagic.com/issues/show_bug.cgi?id=8733 and duplicate http://d.puremagic.com/issues/show_bug.cgi?id=8736

This is a workaround for passing flags to Optlink which uses forward slashes for switches. Running DMD with `-offoo/bar` or `odfoo/bar` would cause these linker errors:

```
OPTLINK : Warning 9: Unknown Option : BAR
OPTLINK : Warning 9: Unknown Option : BAR
user32.def(0) : Error 2: File Not Found user32.def
```

This pull converts forward slashes to backslashes (only on Windows targets).

Note that I can't add test-cases because the tester seems to automatically convert forward slashes to backslashes, which defeats the purpose of the fix.

I'd like to hear from @WalterBright if this is a good patch.