forked from enlightenment/efl
Fixing two buggers here:
- profile selection saving before we assure the dir is there - wrongly setting data dir at buffers SVN revision: 54002
This commit is contained in:
parent
1817b42e26
commit
0699115dae
|
@ -301,9 +301,7 @@ _elm_data_dir_snprintf(char *dst, size_t size, const char *fmt, ...)
|
||||||
size_t data_dir_len, off;
|
size_t data_dir_len, off;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
data_dir_len = eina_str_join_len(dst, size, '/', _elm_data_dir,
|
data_dir_len = eina_strlcpy(dst, _elm_data_dir, size);
|
||||||
strlen(_elm_data_dir), "config",
|
|
||||||
sizeof("config") - 1);
|
|
||||||
|
|
||||||
off = data_dir_len + 1;
|
off = data_dir_len + 1;
|
||||||
if (off >= size)
|
if (off >= size)
|
||||||
|
@ -493,9 +491,8 @@ _elm_config_profiles_list(void)
|
||||||
static void
|
static void
|
||||||
_profile_fetch_from_conf(void)
|
_profile_fetch_from_conf(void)
|
||||||
{
|
{
|
||||||
Eet_File *ef = NULL;
|
|
||||||
const char *home = NULL;
|
|
||||||
char buf[PATH_MAX], *p, *s;
|
char buf[PATH_MAX], *p, *s;
|
||||||
|
Eet_File *ef = NULL;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
|
||||||
_elm_profile = strdup("default");
|
_elm_profile = strdup("default");
|
||||||
|
@ -509,9 +506,6 @@ _profile_fetch_from_conf(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
home = getenv("HOME");
|
|
||||||
if (!home) home = "/";
|
|
||||||
|
|
||||||
// user profile
|
// user profile
|
||||||
_elm_user_dir_snprintf(buf, sizeof(buf), "config/profile.cfg");
|
_elm_user_dir_snprintf(buf, sizeof(buf), "config/profile.cfg");
|
||||||
ef = eet_open(buf, EET_FILE_MODE_READ);
|
ef = eet_open(buf, EET_FILE_MODE_READ);
|
||||||
|
@ -788,9 +782,6 @@ _elm_config_save(void)
|
||||||
Eet_File *ef;
|
Eet_File *ef;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
if (!_elm_config_profile_save())
|
|
||||||
return EINA_FALSE;
|
|
||||||
|
|
||||||
len = _elm_user_dir_snprintf(buf, sizeof(buf), "config/%s", _elm_profile);
|
len = _elm_user_dir_snprintf(buf, sizeof(buf), "config/%s", _elm_profile);
|
||||||
if (len + 1 >= sizeof(buf))
|
if (len + 1 >= sizeof(buf))
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
|
@ -803,6 +794,9 @@ _elm_config_save(void)
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!_elm_config_profile_save())
|
||||||
|
return EINA_FALSE;
|
||||||
|
|
||||||
buf[len] = '/';
|
buf[len] = '/';
|
||||||
len++;
|
len++;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue