mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge branch 'master' into DDRace
This commit is contained in:
commit
c08ed41a7e
|
@ -999,6 +999,17 @@ int fs_chdir(const char *path)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *fs_getcwd(char *buffer, int buffer_size)
|
||||||
|
{
|
||||||
|
if(buffer == 0)
|
||||||
|
return 0;
|
||||||
|
#if defined(CONF_FAMILY_WINDOWS)
|
||||||
|
return _getcwd(buffer, buffer_size);
|
||||||
|
#else
|
||||||
|
return getcwd(buffer, buffer_size);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
int fs_parent_dir(char *path)
|
int fs_parent_dir(char *path)
|
||||||
{
|
{
|
||||||
char *parent = 0;
|
char *parent = 0;
|
||||||
|
|
|
@ -993,6 +993,15 @@ int fs_is_dir(const char *path);
|
||||||
*/
|
*/
|
||||||
int fs_chdir(const char *path);
|
int fs_chdir(const char *path);
|
||||||
|
|
||||||
|
/*
|
||||||
|
Function: fs_getcwd
|
||||||
|
Gets the current working directory.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Returns a pointer to the buffer on success, 0 on failure.
|
||||||
|
*/
|
||||||
|
char *fs_getcwd(char *buffer, int buffer_size);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Function: fs_parent_dir
|
Function: fs_parent_dir
|
||||||
Get the parent directory of a directory
|
Get the parent directory of a directory
|
||||||
|
|
|
@ -21,6 +21,7 @@ public:
|
||||||
int m_NumPaths;
|
int m_NumPaths;
|
||||||
char m_aDatadir[MAX_PATH_LENGTH];
|
char m_aDatadir[MAX_PATH_LENGTH];
|
||||||
char m_aUserdir[MAX_PATH_LENGTH];
|
char m_aUserdir[MAX_PATH_LENGTH];
|
||||||
|
char m_aCurrentdir[MAX_PATH_LENGTH];
|
||||||
|
|
||||||
CStorage()
|
CStorage()
|
||||||
{
|
{
|
||||||
|
@ -38,6 +39,10 @@ public:
|
||||||
// get datadir
|
// get datadir
|
||||||
FindDatadir(ppArguments[0]);
|
FindDatadir(ppArguments[0]);
|
||||||
|
|
||||||
|
// get currentdir
|
||||||
|
if(!fs_getcwd(m_aCurrentdir, sizeof(m_aCurrentdir)))
|
||||||
|
m_aCurrentdir[0] = 0;
|
||||||
|
|
||||||
// load paths from storage.cfg
|
// load paths from storage.cfg
|
||||||
LoadPaths(ppArguments[0]);
|
LoadPaths(ppArguments[0]);
|
||||||
|
|
||||||
|
@ -134,7 +139,7 @@ public:
|
||||||
else if(!str_comp(pPath, "$CURRENTDIR"))
|
else if(!str_comp(pPath, "$CURRENTDIR"))
|
||||||
{
|
{
|
||||||
m_aaStoragePaths[m_NumPaths++][0] = 0;
|
m_aaStoragePaths[m_NumPaths++][0] = 0;
|
||||||
dbg_msg("storage", "added path '$CURRENTDIR'");
|
dbg_msg("storage", "added path '$CURRENTDIR' ('%s')", m_aCurrentdir);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue