mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
~ resolved at config save
This commit is contained in:
parent
e4829981b1
commit
b9d98efc0b
|
@ -66,12 +66,12 @@ void config_set(const char *line)
|
||||||
|
|
||||||
void config_load(const char *filename)
|
void config_load(const char *filename)
|
||||||
{
|
{
|
||||||
|
char full_path[1024];
|
||||||
if (filename[0] == '~')
|
if (filename[0] == '~')
|
||||||
{
|
{
|
||||||
char *home = getenv("HOME");
|
char *home = getenv("HOME");
|
||||||
if (home)
|
if (home)
|
||||||
{
|
{
|
||||||
char full_path[1024];
|
|
||||||
sprintf(full_path, "%s%s", home, filename+1);
|
sprintf(full_path, "%s%s", home, filename+1);
|
||||||
filename = full_path;
|
filename = full_path;
|
||||||
}
|
}
|
||||||
|
@ -96,12 +96,12 @@ void config_load(const char *filename)
|
||||||
|
|
||||||
void config_save(const char *filename)
|
void config_save(const char *filename)
|
||||||
{
|
{
|
||||||
|
char full_path[1024];
|
||||||
if (filename[0] == '~')
|
if (filename[0] == '~')
|
||||||
{
|
{
|
||||||
char *home = getenv("HOME");
|
char *home = getenv("HOME");
|
||||||
if (home)
|
if (home)
|
||||||
{
|
{
|
||||||
char full_path[1024];
|
|
||||||
sprintf(full_path, "%s%s", home, filename+1);
|
sprintf(full_path, "%s%s", home, filename+1);
|
||||||
filename = full_path;
|
filename = full_path;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue