From 759ae312b51ddf912cb0e72be5e70f0b32815e01 Mon Sep 17 00:00:00 2001 From: wizou Date: Wed, 14 Apr 2010 14:27:51 +0000 Subject: [PATCH] Reducing exehead by 9 bytes and making Anders happy git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6053 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/exec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/exehead/exec.c b/Source/exehead/exec.c index c3fb8e86..ed56bc06 100644 --- a/Source/exehead/exec.c +++ b/Source/exehead/exec.c @@ -1177,13 +1177,15 @@ static int NSISCALL ExecuteEntry(entry *entry_) break; case EW_READINISTR: { - TCHAR errstr[] = _T("!N~"); + // GetPrivateProfileString can't read CR & LF characters inside values from INI files + // so we use "\n" as a detection system to see if we did succesfully read a value + const TCHAR errstr[] = _T("\n"); TCHAR *p=var0; TCHAR *buf0=GetStringFromParm(0x01); TCHAR *buf1=GetStringFromParm(0x12); TCHAR *buf2=GetStringFromParm(-0x23); GetPrivateProfileString(buf0,buf1,errstr,p,NSIS_MAX_STRLEN-1,buf2); - if (lstrcmp(p, errstr) == 0) + if (p[0] == _T('\n')) // we got the default string "\n" instead of a real value { exec_error++; p[0]=0;