From: Steve Holme Date: Wed, 30 Apr 2014 22:24:42 +0000 (+0100) Subject: build: Fixed generation when source file names contain spaces X-Git-Tag: curl-7_37_0~93 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3d77d013e1b55aab711683eb90b72bad651efbeb;p=thirdparty%2Fcurl.git build: Fixed generation when source file names contain spaces This shouldn't happen with the source files in the repository, but fixed the output when there are spurious files lying around that contain spaces. For example "pop3 - Copy.c" By including the offending source file in the project files the user can then see the file and remove it if necessary. --- diff --git a/projects/generate.bat b/projects/generate.bat index dfbc3fc9c7..fed472e04c 100644 --- a/projects/generate.bat +++ b/projects/generate.bat @@ -87,21 +87,21 @@ rem set "var=!var:*:=!" if "!var!" == "CURL_SRC_C_FILES" ( - for /f %%c in ('dir /b ..\src\*.c') do call :element %1 src %%c %3 + for /f "delims=" %%c in ('dir /b ..\src\*.c') do call :element %1 src "%%c" %3 ) else if "!var!" == "CURL_SRC_H_FILES" ( - for /f %%h in ('dir /b ..\src\*.h') do call :element %1 src %%h %3 + for /f "delims=" %%h in ('dir /b ..\src\*.h') do call :element %1 src "%%h" %3 ) else if "!var!" == "CURL_SRC_RC_FILES" ( - for /f %%r in ('dir /b ..\src\*.rc') do call :element %1 src %%r %3 + for /f "delims=" %%r in ('dir /b ..\src\*.rc') do call :element %1 src "%%r" %3 ) else if "!var!" == "CURL_LIB_C_FILES" ( - for /f %%c in ('dir /b ..\lib\*.c') do call :element %1 lib %%c %3 + for /f "delims=" %%c in ('dir /b ..\lib\*.c') do call :element %1 lib "%%c" %3 ) else if "!var!" == "CURL_LIB_H_FILES" ( - for /f %%h in ('dir /b ..\lib\*.h') do call :element %1 lib %%h %3 + for /f "delims=" %%h in ('dir /b ..\lib\*.h') do call :element %1 lib "%%h" %3 ) else if "!var!" == "CURL_LIB_RC_FILES" ( - for /f %%r in ('dir /b ..\lib\*.rc') do call :element %1 lib %%r %3 + for /f "delims=" %%r in ('dir /b ..\lib\*.rc') do call :element %1 lib "%%r" %3 ) else if "!var!" == "CURL_LIB_VTLS_C_FILES" ( - for /f %%c in ('dir /b ..\lib\vtls\*.c') do call :element %1 lib\vtls %%c %3 + for /f "delims=" %%c in ('dir /b ..\lib\vtls\*.c') do call :element %1 lib\vtls "%%c" %3 ) else if "!var!" == "CURL_LIB_VTLS_H_FILES" ( - for /f %%h in ('dir /b ..\lib\vtls\*.h') do call :element %1 lib\vtls %%h %3 + for /f "delims=" %%h in ('dir /b ..\lib\vtls\*.h') do call :element %1 lib\vtls "%%h" %3 ) else ( echo.!var!>> %3 ) @@ -129,26 +129,26 @@ rem if "%1" == "dsp" ( echo # Begin Source File>> %4 echo.>> %4 - echo SOURCE=..\..\..\..\%2\%3>> %4 + echo SOURCE=..\..\..\..\%2\%~3>> %4 echo # End Source File>> %4 ) else if "%1" == "vcproj1" ( echo %TABS%^> %4 - echo %TABS% RelativePath="..\..\..\..\%2\%3"^>>> %4 + echo %TABS% RelativePath="..\..\..\..\%2\%~3"^>>> %4 echo %TABS%^>> %4 ) else if "%1" == "vcproj2" ( echo %TABS%^> %4 - echo %TABS% RelativePath="..\..\..\..\%2\%3">> %4 + echo %TABS% RelativePath="..\..\..\..\%2\%~3">> %4 echo %TABS%^>>> %4 echo %TABS%^>> %4 ) else if "%1" == "vcxproj" ( call :extension %3 ext if "%ext%" == "c" ( - echo %SPACES%^>> %4 + echo %SPACES%^>> %4 ) else if "%ext%" == "h" ( - echo %SPACES%^>> %4 + echo %SPACES%^>> %4 ) else if "%ext%" == "rc" ( - echo %SPACES%^>> %4 + echo %SPACES%^>> %4 ) ) @@ -160,7 +160,7 @@ rem %1 - The filename rem %2 - The return value rem :extension - set fname=%1 + set fname=%~1 set ename= :loop1 if "%fname%"=="" (