We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 852 - Build script fails when project directory path include spaces
Summary: Build script fails when project directory path include spaces
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: build (show other bugs)
Version: HG 2.0
Hardware: x86 Windows (XP)
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-17 14:17 UTC by Jesse Anders
Modified: 2009-10-17 20:34 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Anders 2009-10-17 14:17:25 UTC
In VC++, the build script that creates SDL_config.h and SDL_revision.h fails when the project directory path includes spaces. For example, if the project directory path is:

c:\Documents and Settings\Jesse\My Documents\Visual Studio 2008\Projects\SDL 1.3\VisualC\SDL\

The following error is generated:

'and' is not recognized as an internal or external command

Placing all paths in quotes fixes this.

I don't know if this qualifies as a 'bug' (in fact, it could just be user error), but I thought I'd file it just in case. Here is the revised script in its entirety:

if exist "$(ProjectDir)\..\..\include\SDL_config.h" goto SDLCONFIGOKAY
echo Copying SDL_config_win32.h to SDL_config.h...
copy "$(ProjectDir)\..\..\include\SDL_config_win32.h" "$(ProjectDir)\..\..\include\SDL_config.h"
:SDLCONFIGOKAY

if exist "$(ProjectDir)\..\..\include\SDL_revision.h" goto SDLREVISIONOKAY
echo Creating stub SDL_revision.h file...
echo #define SDL_REVISION 0 >"$(ProjectDir)\..\..\include\SDL_revision.h"
:SDLREVISIONOKAY
Comment 1 Sam Lantinga 2009-10-17 14:46:26 UTC
Thanks!  This should be fixed in subversion, can you try it out?
Comment 2 Jesse Anders 2009-10-17 16:05:53 UTC
> This should be fixed in subversion, can you try it out?

Absolutely :)

When loading the solution (in VC++ 9.0), an XML parse error is generated due to the nested quotes in the following:

				CommandLine="if exist "$(ProjectDir)\..\..\include\SDL_config.h" goto SDLCONFIGOKAY
echo Copying SDL_config_win32.h to SDL_config.h...
copy "$(ProjectDir)\..\..\include\SDL_config_win32.h" "$(ProjectDir)\..\..\include\SDL_config.h"
:SDLCONFIGOKAY

if exist "$(ProjectDir)\..\..\include\SDL_revision.h" goto SDLREVISIONOKAY
echo Creating stub SDL_revision.h file...
echo #define SDL_REVISION 0 >"$(ProjectDir)\..\..\include\SDL_revision.h"
:SDLREVISIONOKAY"

If I replace each nested quote with '"' and then load the project, the project loads successfully, and the build script works.

Let me know if you need any other info.
Comment 3 Sam Lantinga 2009-10-17 16:33:12 UTC
Got it, thanks!
Comment 4 Jesse Anders 2009-10-17 18:01:31 UTC
(In reply to comment #3)
> Got it, thanks!

Just to confirm, everything appears to be working correctly now.

Thanks :)
Comment 5 Sam Lantinga 2009-10-17 20:34:45 UTC
Great, thanks for the fix and the followup! :)