[geany/geany] 51ce10: Always use absolute path when opening projects from command-line

Jiří Techet git-noreply at xxxxx
Wed Mar 4 13:34:55 UTC 2015

Branch:      refs/heads/master
Author:      Jiří Techet <techet at gmail.com>
Committer:   Jiří Techet <techet at gmail.com>
Date:        Wed, 04 Mar 2015 13:34:55 UTC
Commit:      51ce1018cccbc6a6c0c3614d1d4e29daea9ab606

Log Message:
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.

Modified Paths:

Modified: src/main.c
5 lines changed, 4 insertions(+), 1 deletions(-)
@@ -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:

This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).

More information about the Commits mailing list