Define DIR_SEPARATOR to deal with the Windows / Linux folder separators.

git-svn-id: svn://svn.code.sf.net/p/hxcfloppyemu/code/HxCFloppyEmulator/libhxcadaptor/trunk@1755 63fa2f70-6a9b-4bc4-b855-9c6a949b1d69
This commit is contained in:
Jean-François DEL NERO
2019-08-18 08:23:21 +00:00
parent e991f6d7a6
commit 2f1bec3d1b
2 changed files with 10 additions and 2 deletions
+2 -2
View File
@@ -408,12 +408,12 @@ char * hxc_getfilenamebase(char * fullpath,char * filenamebase)
if(len)
{
i=len-1;
while(i && (fullpath[i]!='\\' && fullpath[i]!='/' && fullpath[i]!=':') )
while(i && ( fullpath[i] != DIR_SEPARATOR_CHAR && fullpath[i]!=':') )
{
i--;
}
if( fullpath[i]=='\\' || fullpath[i]=='/' || fullpath[i]==':' )
if( fullpath[i] == DIR_SEPARATOR_CHAR || fullpath[i]==':' )
{
i++;
}
+8
View File
@@ -2,6 +2,14 @@
extern "C" {
#endif
#ifdef WIN32
#define DIR_SEPARATOR "\\"
#define DIR_SEPARATOR_CHAR '\\'
#else
#define DIR_SEPARATOR "/"
#define DIR_SEPARATOR_CHAR '/'
#endif
/////////////// Thread functions ////////////////
typedef int (*THREADFUNCTION) (void* floppyemulator,void* hwemulator);