mirror of
https://github.com/cc65/cc65.git
synced 2025-08-12 02:25:03 +00:00
Fixed generation of o65 timestamp
git-svn-id: svn://svn.cc65.org/cc65/trunk@1946 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -39,6 +39,7 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
/* common */
|
/* common */
|
||||||
|
#include "chartype.h"
|
||||||
#include "check.h"
|
#include "check.h"
|
||||||
#include "print.h"
|
#include "print.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
@@ -1274,8 +1275,9 @@ static void O65SetupHeader (O65Desc* D)
|
|||||||
void O65WriteTarget (O65Desc* D, File* F)
|
void O65WriteTarget (O65Desc* D, File* F)
|
||||||
/* Write an o65 output file */
|
/* Write an o65 output file */
|
||||||
{
|
{
|
||||||
char OptBuf [256]; /* Buffer for option strings */
|
char OptBuf [256]; /* Buffer for option strings */
|
||||||
time_t T;
|
unsigned OptLen;
|
||||||
|
time_t T;
|
||||||
|
|
||||||
/* Place the filename in the control structure */
|
/* Place the filename in the control structure */
|
||||||
D->Filename = F->Name;
|
D->Filename = F->Name;
|
||||||
@@ -1308,7 +1310,12 @@ void O65WriteTarget (O65Desc* D, File* F)
|
|||||||
/* Define some more options: A timestamp and the linker version */
|
/* Define some more options: A timestamp and the linker version */
|
||||||
T = time (0);
|
T = time (0);
|
||||||
strcpy (OptBuf, ctime (&T));
|
strcpy (OptBuf, ctime (&T));
|
||||||
O65SetOption (D, O65OPT_TIMESTAMP, OptBuf, strlen (OptBuf) + 1);
|
OptLen = strlen (OptBuf);
|
||||||
|
while (OptLen > 0 && IsControl (OptBuf[OptLen-1])) {
|
||||||
|
--OptLen;
|
||||||
|
}
|
||||||
|
OptBuf[OptLen] = '\0';
|
||||||
|
O65SetOption (D, O65OPT_TIMESTAMP, OptBuf, OptLen + 1);
|
||||||
sprintf (OptBuf, "ld65 V%u.%u.%u", VER_MAJOR, VER_MINOR, VER_PATCH);
|
sprintf (OptBuf, "ld65 V%u.%u.%u", VER_MAJOR, VER_MINOR, VER_PATCH);
|
||||||
O65SetOption (D, O65OPT_ASM, OptBuf, strlen (OptBuf) + 1);
|
O65SetOption (D, O65OPT_ASM, OptBuf, strlen (OptBuf) + 1);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user