Allow /INPUTCHARSET early on the command line.

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6351 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2013-05-04 14:33:09 +00:00
parent 0653f46c07
commit 5878480fdc
2 changed files with 4 additions and 4 deletions

View file

@ -297,7 +297,8 @@ int _tmain(int argc, TCHAR **argv)
if (_T('-') == argv[argpos][0] && !argv[argpos][1]) continue; // stdin
const TCHAR *swname = &argv[argpos][1];
if (!_tcsicmp(swname,_T("VERSION"))) argc=0;
if (!_tcsicmp(swname,_T("INPUTCHARSET")) || !_tcsicmp(swname,_T("ICS"))) ++argpos; // Skip
else if (!_tcsicmp(swname,_T("VERSION"))) argc=0;
else if (!_tcsicmp(swname,_T("NOTIFYHWND")))
{
initialparsefail=!HasReqParam(argv,++argpos,argc,true);
@ -507,11 +508,10 @@ int _tmain(int argc, TCHAR **argv)
}
cmds_processed++;
}
// Already parsed these
// Already parsed these ("VERSION" never gets this far)
#ifdef _WIN32
else if (!_tcsicmp(&argv[argpos][1],_T("RAW"))) {}
#endif
else if (!_tcsicmp(&argv[argpos][1],_T("VERSION"))) {}
else if (S7IsChEqualI('o',argv[argpos][1]) && argv[argpos][2]) {}
else
break;

View file

@ -795,7 +795,7 @@ bool WINAPI WinStdIO_OStreamInit(WINSIO_OSDATA&osd, FILE*strm, WORD cp, int bom)
bool succ = NStream::SetBinaryMode(fd);
DWORD cbio = 0;
ULARGE_INTEGER uli;
if (succ && GetFileSize64(osd.hNative, uli) && uli.QuadPart)
if (succ && 0 != bom && GetFileSize64(osd.hNative, uli) && uli.QuadPart)
{
OVERLAPPED olap = {0}; // Used to read from start of file
unsigned char bufbom[4];