mirror of
https://github.com/cc65/cc65.git
synced 2025-08-13 08:25:28 +00:00
Use routine from common library instead of separate code.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4942 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -1,15 +1,15 @@
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* */
|
/* */
|
||||||
/* objfile.c */
|
/* objfile.c */
|
||||||
/* */
|
/* */
|
||||||
/* Object file handling for the ar65 archiver */
|
/* Object file handling for the ar65 archiver */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* (C) 1998-2003 Ullrich von Bassewitz */
|
/* (C) 1998-2011, Ullrich von Bassewitz */
|
||||||
/* R<EFBFBD>merstra<EFBFBD>e 52 */
|
/* Roemerstrasse 52 */
|
||||||
/* D-70794 Filderstadt */
|
/* D-70794 Filderstadt */
|
||||||
/* EMail: uz@cc65.org */
|
/* EMail: uz@cc65.org */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* This software is provided 'as-is', without any expressed or implied */
|
/* This software is provided 'as-is', without any expressed or implied */
|
||||||
@@ -46,6 +46,7 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
/* common */
|
/* common */
|
||||||
|
#include "fname.h"
|
||||||
#include "xmalloc.h"
|
#include "xmalloc.h"
|
||||||
|
|
||||||
/* ar65 */
|
/* ar65 */
|
||||||
@@ -67,17 +68,14 @@ static const char* GetModule (const char* Name)
|
|||||||
/* Get a module name from the file name */
|
/* Get a module name from the file name */
|
||||||
{
|
{
|
||||||
/* Make a module name from the file name */
|
/* Make a module name from the file name */
|
||||||
const char* Module = Name + strlen (Name);
|
const char* Module = FindName (Name);
|
||||||
while (Module > Name) {
|
|
||||||
--Module;
|
/* Must not end with a path separator */
|
||||||
if (*Module == '/' || *Module == '\\') {
|
|
||||||
++Module;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (*Module == 0) {
|
if (*Module == 0) {
|
||||||
Error ("Cannot make module name from `%s'", Name);
|
Error ("Cannot make module name from `%s'", Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Done */
|
||||||
return Module;
|
return Module;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,9 +162,9 @@ void ObjAdd (const char* Name)
|
|||||||
Error ("Could not open `%s': %s", Name, strerror (errno));
|
Error ("Could not open `%s': %s", Name, strerror (errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the modification time of the object file. There a race condition
|
/* Get the modification time of the object file. There a race condition
|
||||||
* here, since we cannot use fileno() (non standard identifier in standard
|
* here, since we cannot use fileno() (non standard identifier in standard
|
||||||
* header file), and therefore not fstat. When using stat with the
|
* header file), and therefore not fstat. When using stat with the
|
||||||
* file name, there's a risk that the file was deleted and recreated
|
* file name, there's a risk that the file was deleted and recreated
|
||||||
* while it was open. Since mtime and size are only used to check
|
* while it was open. Since mtime and size are only used to check
|
||||||
* if a file has changed in the debugger, we will ignore this problem
|
* if a file has changed in the debugger, we will ignore this problem
|
||||||
|
Reference in New Issue
Block a user