tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 53115] catalina.bat run does not work if TEMP contains spaces
Date Thu, 31 May 2012 16:19:00 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=53115

--- Comment #12 from Sebb <sebb@apache.org> ---
AFAICT, the TEMP directory is being used for two purposes:

1) for a file containing "Y"
2) as a marker to stop a recursive call of catalina.bat

The first use is trivial to eliminate; just ship Tomcat with a suitable file

The second use can also be eliminated.

If you can assume that Command Extensions are enabled, the following will work:

rem Suppress Terminate batch job on CTRL+C
if not ""%1"" == ""run"" goto mainEntry
if ""%TEMP%"" == """" goto mainEntry
rem Assumes Y.DAT exists
call :mainEntry %* <Y.DAT
rem Use provided errorlevel
set RETVAL=%ERRORLEVEL%
exit /B %RETVAL%
:mainEntry

If not, then rather than using a marker file in TEMP, you can use a SET
variable:

rem Suppress Terminate batch job on CTRL+C
if not ""%1"" == ""run"" goto mainEntry
if ""%TEMP%"" == """" goto mainEntry
if ""%_RECURSE_%"" == ""TrUe"" goto mainEntry
set _RECURSE_=TrUe
call "%~f0" %* <Y.DAT
rem Use provided errorlevel
set RETVAL=%ERRORLEVEL%
set _RECURSE_=
exit /B %RETVAL%
:mainEntry

Yet another possibility is to split catalina.bat into two so the mainEntry code
is in a separate file. This solves the recursive call issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message