From 3c26c3bfd37a95c3394e58d9a97bdd8e30cff1f3 Mon Sep 17 00:00:00 2001 From: kichik Date: Thu, 20 Feb 2003 18:47:58 +0000 Subject: [PATCH] CreateDireectory now sets the error flag only when really needed instead of almost always git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2195 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/exec.c | 4 +++- Source/exehead/util.c | 4 ++-- Source/exehead/util.h | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Source/exehead/exec.c b/Source/exehead/exec.c index c16a68c9..916689d4 100644 --- a/Source/exehead/exec.c +++ b/Source/exehead/exec.c @@ -258,7 +258,9 @@ static int NSISCALL ExecuteEntry(entry *entry_) while (*p != '\\' && *p) p=CharNext(p); c=*p; *p=0; - g_flags.exec_error += !CreateDirectory(buf1,NULL); + if (!file_exists(buf1)) { + g_flags.exec_error += !CreateDirectory(buf1,NULL); + } *p++ = c; } } diff --git a/Source/exehead/util.c b/Source/exehead/util.c index fb323b6d..06e78af4 100644 --- a/Source/exehead/util.c +++ b/Source/exehead/util.c @@ -103,10 +103,10 @@ char *NSISCALL addtrailingslash(char *str) return str; } -char NSISCALL lastchar(const char *str) +/*char NSISCALL lastchar(const char *str) { return *CharPrev(str,str+mystrlen(str)); -} +}*/ void NSISCALL trimslashtoend(char *buf) { diff --git a/Source/exehead/util.h b/Source/exehead/util.h index 338f396d..3ea67cbc 100644 --- a/Source/exehead/util.h +++ b/Source/exehead/util.h @@ -49,7 +49,8 @@ void NSISCALL doRMDir(char *buf, int recurse); HANDLE NSISCALL myOpenFile(const char *fn, DWORD da, DWORD cd); int NSISCALL validpathspec(char *ubuf); char * NSISCALL addtrailingslash(char *str); -char NSISCALL lastchar(const char *str); +//char NSISCALL lastchar(const char *str); +#define lastchar(str) *CharPrev(str,str+mystrlen(str)) void NSISCALL trimslashtoend(char *buf); char * NSISCALL scanendslash(const char *str); int NSISCALL is_valid_instpath(char *s);