- converted ctime_r to ctime for better portability

- more refactoring


git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3691 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2004-10-01 19:52:56 +00:00
parent 80f062d8ce
commit a4cad316e7
5 changed files with 36 additions and 73 deletions

View file

@ -58,8 +58,8 @@ char *CEXEBuild::set_timestamp_predefine(char *filename)
definedlist.del("__TIMESTAMP__");
}
char timestampbuf[256] = "";
#ifdef _WIN32
char timestampbuf[256] = "";
char datebuf[128] = "";
char timebuf[128] = "";
WIN32_FIND_DATA fd;
@ -83,13 +83,7 @@ char *CEXEBuild::set_timestamp_predefine(char *filename)
#else
struct stat st;
if (!stat(filename, &st))
{
ctime_r(&st.st_mtime, timestampbuf);
char *p = timestampbuf + strlen(timestampbuf);
while (!*p || *p == '\n')
*p-- = 0;
definedlist.add("__TIMESTAMP__",timestampbuf);
}
definedlist.add("__TIMESTAMP__",ctime(&st.st_mtime));
#endif
return oldtimestamp;