mirror of
https://github.com/akuker/RASCSI.git
synced 2025-07-18 04:24:11 +00:00
Feature baremetal removal (#140)
* Removed all BAREMETAL ifdefs * Cleaned up subfolders * Fixed regression * Re-added underscores * Fixed merge conflicts * Assume RASCSI is always defined * Fixed mege issue * Re-added result message * Fix typo Co-authored-by: akuker <34318535+akuker@users.noreply.github.com>
This commit is contained in:
@@ -84,80 +84,6 @@ void FASTCALL Filepath::SetPath(LPCSTR path)
|
||||
Split();
|
||||
}
|
||||
|
||||
#ifdef BAREMETAL
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// 互換関数(dirname) 結果は直ぐにコピーせよ
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
static char dirtmp[2];
|
||||
char* dirname(char *path)
|
||||
{
|
||||
char *p;
|
||||
if( path == NULL || *path == '\0' ) {
|
||||
dirtmp[0] = '.';
|
||||
dirtmp[1] = '\0';
|
||||
return dirtmp;
|
||||
}
|
||||
|
||||
p = path + strlen(path) - 1;
|
||||
while( *p == '/' ) {
|
||||
if( p == path )
|
||||
return path;
|
||||
*p-- = '\0';
|
||||
}
|
||||
|
||||
while( p >= path && *p != '/' ) {
|
||||
p--;
|
||||
}
|
||||
|
||||
if (p < path) {
|
||||
dirtmp[0] = '.';
|
||||
dirtmp[1] = '\0';
|
||||
return dirtmp;
|
||||
}
|
||||
|
||||
if (p == path) {
|
||||
dirtmp[0] = '/';
|
||||
dirtmp[1] = '\0';
|
||||
return dirtmp;
|
||||
}
|
||||
|
||||
*p = 0;
|
||||
return path;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// 互換関数(basename) 結果は直ぐにコピーせよ
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
static char basetmp[2];
|
||||
char* basename(char *path)
|
||||
{
|
||||
char *p;
|
||||
if( path == NULL || *path == '\0' ) {
|
||||
basetmp[0] = '/';
|
||||
basetmp[1] = '\0';
|
||||
return basetmp;
|
||||
}
|
||||
|
||||
p = path + strlen(path) - 1;
|
||||
while( *p == '/' ) {
|
||||
if( p == path ) {
|
||||
return path;
|
||||
}
|
||||
*p-- = '\0';
|
||||
}
|
||||
|
||||
while( p >= path && *p != '/' ) {
|
||||
p--;
|
||||
}
|
||||
|
||||
return p + 1;
|
||||
}
|
||||
#endif // BAREMETAL
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// パス分離
|
||||
|
Reference in New Issue
Block a user