Message5558

Author AndreasEK
Recipients AndreasEK
Date 2010-03-03.21:44:39
SpamBayes Score 0.00089977664
Marked as misclassified No
Message-id <1267652680.98.0.368705400166.issue1567@psf.upfronthosting.co.za>
In-reply-to
Content
When running jython.bat, this code is expanding a * into a filename, when trying to dequote a parameter:

:getArg
rem remove quotes around first arg
for %%i in (%1) do set _CMP=%%~i
set _ARGS=%2
goto :EOF

The problem is that the for loop looks for filenames which match the pattern given in %1. With a little script from http://ss64.com/nt/syntax-dequote.html I was able to fix that problem:

:getArg
rem remove quotes around first arg
set _CMP=%1
CALL:deQuote _CMP
set _ARGS=%2
goto :EOF

...

:DeQuote

SET _DeQuoteVar=%1
CALL SET _DeQuoteString=%%!_DeQuoteVar!%%
IF [!_DeQuoteString:~0^,1!]==[^"] (
IF [!_DeQuoteString:~-1!]==[^"] (
SET _DeQuoteString=!_DeQuoteString:~1,-1!
) ELSE (GOTO :EOF)
) ELSE (GOTO :EOF)
SET !_DeQuoteVar!=!_DeQuoteString!
SET _DeQuoteVar=
SET _DeQuoteString=
GOTO :EOF
History
Date User Action Args
2010-03-03 21:44:41AndreasEKsetrecipients: + AndreasEK
2010-03-03 21:44:40AndreasEKsetmessageid: <1267652680.98.0.368705400166.issue1567@psf.upfronthosting.co.za>
2010-03-03 21:44:40AndreasEKlinkissue1567 messages
2010-03-03 21:44:39AndreasEKcreate