Skip to content

Commit

Permalink
Linux: rewrite _splitpath implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleivg committed Aug 20, 2018
1 parent d4525f7 commit a29d838
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Common/PlatformLinux.inl
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,17 @@ inline void Sleep(int ms)
usleep(ms * 1000);
}

#include <libgen.h>
#include <libgen.h>
inline void _splitpath (
const char* path, // Path Input
char* drive, // Drive : Output
char* dir, // Directory : Output
char* fname, // Filename : Output
char* ext // Extension : Output
){
char *tmp = NULL;
tmp = realpath(path, NULL);
char tmp[PATH_MAX] = {0};
if(!realpath(path, tmp))
strcpy(tmp, path);

if(drive)
strcpy(drive, "");
Expand All @@ -109,8 +110,6 @@ inline void _splitpath (

if(fname)
strcpy(fname, basename(tmp));

free(tmp);
}

#include <iostream>
Expand Down

0 comments on commit a29d838

Please sign in to comment.