X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fld65%2Ffileinfo.c;h=7965d574f6c987a32faf4aab4a8a8317b3b449ba;hb=7bd19b737aacfcf0d81e2bc3a6e537ee72a4eb2f;hp=e8e31b4d2de86d9a4c31948106357701e0dd5f31;hpb=275da22a66d69e2e5ecaa92766104833f0de767a;p=cc65 diff --git a/src/ld65/fileinfo.c b/src/ld65/fileinfo.c index e8e31b4d2..7965d574f 100644 --- a/src/ld65/fileinfo.c +++ b/src/ld65/fileinfo.c @@ -6,10 +6,10 @@ /* */ /* */ /* */ -/* (C) 2001 Ullrich von Bassewitz */ -/* Wacholderweg 14 */ -/* D-70597 Stuttgart */ -/* EMail: uz@cc65.org */ +/* (C) 2001-2010, Ullrich von Bassewitz */ +/* Roemerstrasse 52 */ +/* D-70794 Filderstadt */ +/* EMail: uz@cc65.org */ /* */ /* */ /* This software is provided 'as-is', without any expressed or implied */ @@ -43,7 +43,7 @@ /*****************************************************************************/ -/* Code */ +/* Code */ /*****************************************************************************/ @@ -51,9 +51,15 @@ static FileInfo* NewFileInfo (void) /* Allocate and initialize a new FileInfo struct and return it */ { + /* We will assign file info ids in increasing order of creation */ + static unsigned Id = 0; + /* Allocate memory */ FileInfo* FI = xmalloc (sizeof (FileInfo)); + /* Initialize stuff */ + FI->Id = Id++; + /* Return the new struct */ return FI; } @@ -67,9 +73,9 @@ FileInfo* ReadFileInfo (FILE* F, ObjData* O) FileInfo* FI = NewFileInfo (); /* Read the fields from the file */ + FI->Name = MakeGlobalStringId (O, ReadVar (F)); FI->MTime = Read32 (F); FI->Size = Read32 (F); - FI->Name = ReadStr (F); /* Return the new struct */ return FI;