From 5878480fdcf05ebeeeaa3865eb898414e2aa9950 Mon Sep 17 00:00:00 2001 From: anders_k Date: Sat, 4 May 2013 14:33:09 +0000 Subject: [PATCH] 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 --- Source/makenssi.cpp | 6 +++--- Source/util.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/makenssi.cpp b/Source/makenssi.cpp index 1e1ef761..f6212361 100644 --- a/Source/makenssi.cpp +++ b/Source/makenssi.cpp @@ -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; diff --git a/Source/util.cpp b/Source/util.cpp index 96d33c81..58094b02 100644 --- a/Source/util.cpp +++ b/Source/util.cpp @@ -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];