mirror of
https://github.com/pspdev/pspsdk.git
synced 2025-12-24 12:42:36 +00:00
@@ -28,7 +28,7 @@ GLUE_OBJS = __dummy_passwd.o __fill_stat.o __psp_heap_blockid.o __psp_free_heap.
|
||||
_write.o _fstat.o _stat.o lstat.o access.o _fcntl.o _lseek.o chdir.o mkdir.o rmdir.o getdents.o _seekdir.o _link.o _unlink.o \
|
||||
_rename.o _getpid.o _kill.o _sbrk.o _gettimeofday.o _times.o ftime.o clock_getres.o clock_gettime.o clock_settime.o \
|
||||
_internal_malloc_lock.o _internal_malloc_unlock.o _isatty.o symlink.o truncate.o chmod.o fchmod.o fchmodat.o pathconf.o \
|
||||
readlink.o utime.o fchown.o getentropy.o getpwuid.o fsync.o getpwnam.o getuid.o geteuid.o
|
||||
readlink.o utime.o fchown.o getentropy.o getpwuid.o fsync.o getpwnam.o getuid.o geteuid.o basename.o
|
||||
|
||||
|
||||
INIT_OBJS = __libpthreadglue_init.o __libcglue_init.o __libcglue_deinit.o _exit.o abort.o exit.o
|
||||
|
||||
@@ -1025,3 +1025,20 @@ struct passwd *getpwnam(const char *name) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef F_basename
|
||||
char* basename (char *path)
|
||||
{
|
||||
char *p;
|
||||
if( path == NULL || *path == '\0' )
|
||||
return ".";
|
||||
p = path + strlen(path) - 1;
|
||||
while( *p == '/' ) {
|
||||
if( p == path )
|
||||
return path;
|
||||
*p-- = '\0';
|
||||
}
|
||||
while( p >= path && *p != '/' )
|
||||
p--;
|
||||
return p + 1;
|
||||
}
|
||||
#endif /* F_basename */
|
||||
|
||||
Reference in New Issue
Block a user