mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-19 20:18:09 +00:00
Fix opening of configuration file
Allow passing absolute filename.
This commit is contained in:
parent
cbf99ae504
commit
e48d96c638
1 changed files with 9 additions and 1 deletions
10
gtk/main.c
10
gtk/main.c
|
|
@ -164,7 +164,9 @@ char *linphone_gtk_get_config_file(const char *filename){
|
|||
/*try accessing a local file first if exists*/
|
||||
if (access(CONFIG_FILE,F_OK)==0){
|
||||
snprintf(config_file,path_max,"%s",filename);
|
||||
}else{
|
||||
} else if (g_path_is_absolute(filename)) {
|
||||
snprintf(config_file,path_max,"%s",filename);
|
||||
} else{
|
||||
#ifdef WIN32
|
||||
const char *appdata=getenv("APPDATA");
|
||||
if (appdata){
|
||||
|
|
@ -1924,6 +1926,12 @@ int main(int argc, char *argv[]){
|
|||
return -1;
|
||||
}
|
||||
if (config_file) free(config_file);
|
||||
if (custom_config_file && !g_path_is_absolute(custom_config_file)) {
|
||||
gchar *res = g_get_current_dir();
|
||||
res = g_strjoin(G_DIR_SEPARATOR_S, res, custom_config_file, NULL);
|
||||
free(custom_config_file);
|
||||
custom_config_file = res;
|
||||
}
|
||||
config_file=linphone_gtk_get_config_file(custom_config_file);
|
||||
|
||||
settings=gtk_settings_get_default();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue