4973 – map file with spaces in file name passed without quotes to linker

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4973 - map file with spaces in file name passed without quotes to linker
Summary: map file with spaces in file name passed without quotes to linker
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: link-failure, patch
Depends on:
Blocks:
Reported: 2010年10月02日 00:15 UTC by Rainer Schuetze
Modified: 2015年06月09日 05:11 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Rainer Schuetze 2010年10月02日 00:15:31 UTC
Specifying a map file to dmd that contains spaces like this
 dmd test.d -map "a b.map" -v
produces
binary c:\l\dmd-2.048\windows\bin\dmd.exe
version v2.048
[...]
c:\l\dmd-2.048\windows\bin\link.exe test,,a b.map,user32+kernel32/m/noi;
OPTLINK (R) for Win32 Release 8.00.2
Copyright (C) Digital Mars 1989-2009 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
user32.def(0) : Error 2: File Not Found user32.def
--- errorlevel 1
showing that the map file name is not quoted.
Here's the patch:
Index: link.c
===================================================================
--- link.c	(revision 701)
+++ link.c	(working copy)
@@ -116,7 +116,7 @@
 
 cmdbuf.writeByte(',');
 if (global.params.mapfile)
- cmdbuf.writestring(global.params.mapfile);
+ writeFilename(&cmdbuf, global.params.mapfile);
 else if (global.params.run)
 cmdbuf.writestring("nul");
 cmdbuf.writeByte(',');


AltStyle によって変換されたページ (->オリジナル) /