6 bytes saved (made addtrailingslash return char *)
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1174 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
54bcb4a8e2
commit
372e1f0d11
4 changed files with 8 additions and 11 deletions
|
@ -145,8 +145,7 @@ static BOOL NSISCALL _HandleStaticBkColor(UINT uMsg, WPARAM wParam, LPARAM lPara
|
|||
#ifdef NSIS_CONFIG_LOG
|
||||
void NSISCALL build_g_logfile()
|
||||
{
|
||||
addtrailingslash(mystrcpy(g_log_file,state_install_directory));
|
||||
lstrcat(g_log_file,"install.log");
|
||||
lstrcat(addtrailingslash(mystrcpy(g_log_file,state_install_directory)),"install.log");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -820,8 +819,7 @@ static BOOL CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
|
|||
p=name+mystrlen(name)-mystrlen(post_str);
|
||||
if (p <= name || *CharPrev(name,p)!='\\' || lstrcmpi(p,post_str))
|
||||
{
|
||||
addtrailingslash(name);
|
||||
lstrcat(name,post_str);
|
||||
lstrcat(addtrailingslash(name),post_str);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -357,15 +357,14 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
|||
HANDLE hOut;
|
||||
int ret;
|
||||
char *buf3=process_string_fromparm_tobuf(0x31);
|
||||
#define overwriteflag parm0
|
||||
addtrailingslash(mystrcpy(buf0,state_output_directory));
|
||||
#define overwriteflag parm0
|
||||
|
||||
log_printf3("File: overwriteflag=%d, name=\"%s\"",overwriteflag,buf3);
|
||||
if (validpathspec(buf3))
|
||||
{
|
||||
mystrcpy(buf0,buf3);
|
||||
}
|
||||
else lstrcat(buf0,buf3);
|
||||
else lstrcat(addtrailingslash(mystrcpy(buf0,state_output_directory)),buf3);
|
||||
_tryagain:
|
||||
if (!overwriteflag)
|
||||
{
|
||||
|
@ -1341,8 +1340,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
|||
}
|
||||
else
|
||||
{
|
||||
addtrailingslash(mystrcpy(buf1,state_install_directory));
|
||||
lstrcat(buf1,buf0);
|
||||
lstrcat(addtrailingslash(mystrcpy(buf1,state_install_directory)),buf0);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -87,9 +87,10 @@ void NSISCALL doRMDir(char *buf, int recurse)
|
|||
}
|
||||
#endif//NSIS_SUPPORT_RMDIR
|
||||
|
||||
void NSISCALL addtrailingslash(char *str)
|
||||
char *NSISCALL addtrailingslash(char *str)
|
||||
{
|
||||
if (lastchar(str)!='\\') lstrcat(str,"\\");
|
||||
return str;
|
||||
}
|
||||
|
||||
char NSISCALL lastchar(const char *str)
|
||||
|
|
|
@ -47,7 +47,7 @@ void NSISCALL doRMDir(char *buf, int recurse);
|
|||
HANDLE NSISCALL myOpenFile(const char *fn, DWORD da, DWORD cd);
|
||||
int NSISCALL CreateShortCut(HWND hwnd, LPCSTR pszShortcutFile, LPCSTR pszIconFile, int iconindex, LPCSTR pszExe, LPCSTR pszArg, LPCSTR workingdir, int showmode, int hotkey);
|
||||
int NSISCALL validpathspec(char *ubuf);
|
||||
void NSISCALL addtrailingslash(char *str);
|
||||
char * NSISCALL addtrailingslash(char *str);
|
||||
char NSISCALL lastchar(const char *str);
|
||||
void NSISCALL trimslashtoend(char *buf);
|
||||
char * NSISCALL scanendslash(const char *str);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue