lio
Joined: 28 Apr 2006 Posts: 10 Location: Beijing
|
Posted: Fri Jan 19, 2007 10:43 am Post subject: Bug: bud doesn't correctly handle paths with spaces |
|
|
Classic problem:
Code: | C:\dmd\dwt\import>bud_win_3.04 -lib all.d
'C:\Program' is not recognized as an internal or external command,
operable program or batch file. |
I suspected something so I've placed the following C program as Program.exe in the root:
Code: | // Compile with: cl Program.c /link /ENTRY:main
#pragma comment(lib,"user32.lib")
#pragma comment(lib,"kernel32.lib")
int __stdcall MessageBoxW( void*, short*, short*, int );
short* __stdcall GetCommandLineW(void);
int main(void)
{
return MessageBoxW( 0, GetCommandLineW(), L"Error", 0 );
} |
Resulting in:
Code: | ---------------------------
Error
---------------------------
C:\Program Files (x86)\Microsoft Visual Studio 8\VC\BIN\lib.exe @C:\dmd\dwt\lib\dwtextra.lsp
---------------------------
OK
--------------------------- |
Code: | C:\dmd\dwt\import>where lib
C:\Program Files (x86)\Microsoft Visual Studio 8\VC\bin\lib.exe
c:\dm\bin\lib.exe |
I've fixed it by changing util/fileex.d, line 355, from:
Code: | return RunCommand(pExeName ~ " " ~ pCommand);
|
to:
Code: | return RunCommand(`"` ~ pExeName ~ `" ` ~ pCommand);
|
|
|