From 51ce1018cccbc6a6c0c3614d1d4e29daea9ab606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jir=CC=8Ci=CC=81=20Techet?= Date: Wed, 4 Mar 2015 14:34:55 +0100 Subject: [PATCH] Always use absolute path when opening projects from command-line At the moment when geany project is loaded from commandline using e.g. "geany myproject.geany", the relative path is used by geany so e.g. Project->Recent Projects shows the relative path instead of the absolute one (also if the project is already in the list with an absolute path, additional entry with relative path is created). Use main_get_argv_filename(), which is already used for ordinary files, also for opening .geany files. --- src/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 4deae958..6fa6abc0 100644 --- a/src/main.c +++ b/src/main.c @@ -932,11 +932,14 @@ static void load_startup_files(gint argc, gchar **argv) if (argc > 1 && g_str_has_suffix(argv[1], ".geany")) { + gchar *filename = main_get_argv_filename(argv[1]); + /* project file specified: load it, but decide the session later */ - main_load_project_from_command_line(argv[1], FALSE); + main_load_project_from_command_line(filename, FALSE); argc--, argv++; /* force session load if using project-based session files */ load_session = project_prefs.project_session; + g_free(filename); } /* Load the default session if: