Bug 8733 – Normalize -of path on Windows

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2012-09-27T18:33:00Z
Last change time
2015-06-09T05:14:48Z
Keywords
pull
Assigned to
andrej.mitrovich
Creator
andrej.mitrovich

Comments

Comment #0 by andrej.mitrovich — 2012-09-27T18:33:03Z
Make a .d file in a foo directory, then run: $ dmd foo/test.d ok $ dmd foo/test.d -offoo/main.exe OPTLINK (R) for Win32 Release 8.00.12 Copyright (C) Digital Mars 1989-2010 All rights reserved. http://www.digitalmars.com/ctg/optlink.html OPTLINK : Warning 9: Unknown Option : MAIN OPTLINK : Warning 9: Unknown Option : MAIN.EXE user32.def(0) : Error 2: File Not Found user32.def --- errorlevel 1 DMD should try to normalize the -of path by changing forward slashes to backslashes since Optlink reserves forward slashes for flags.
Comment #1 by andrej.mitrovich — 2012-09-29T16:58:38Z
*** Issue 8736 has been marked as a duplicate of this issue. ***
Comment #2 by andrej.mitrovich — 2012-10-03T20:33:23Z
(In reply to comment #1) > *** Issue 8736 has been marked as a duplicate of this issue. *** Guys is this safe to implement this way?: mars.c: void toWinPath(char* src) { if (src != NULL) { while (*src != '\0') { if (*src == '/') *src = '\\'; src++; } } } case 'f': if (!p[3]) goto Lnoarg; #if TARGET_WINDOS toWinPath(p + 3); #endif It works in simple cases but I'm worried about any Unicode issues and of course UNC paths and whatnot. Is there any standard WinAPI/DMC API function that normalizes the path (converts '/' to '\')?
Comment #3 by andrej.mitrovich — 2012-11-24T15:42:59Z
Comment #4 by github-bugzilla — 2013-06-10T16:33:24Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/5680ab0255f2a2e51674a3dabed8b95ec938280a Fixes Issue 8733 - Turn forward slashes into backslashes on Windows. https://github.com/D-Programming-Language/dmd/commit/cf03d8e3c4433a66269f37b7ea1df7e963be4f1a Merge pull request #1208 from AndrejMitrovic/Fix8733 Issue 8733 - Normalize -of and -od path on Windows