Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix "Open in New Window" command arguments

Closes #590
  • Loading branch information...
commit bff71b3a88f6fc77a32a642d8d638ed91742ce98 1 parent 1b5ec63
@codebrainz codebrainz authored
Showing with 10 additions and 5 deletions.
  1. +10 −5 src/utils.c
View
15 src/utils.c
@@ -2154,24 +2154,29 @@ const gchar *utils_resource_dir(GeanyResourceDirType type)
void utils_start_new_geany_instance(const gchar *doc_path)
{
- const gchar *const *argv;
const gchar *command = is_osx_bundle() ? "open" : "geany";
gchar *exec_path = g_find_program_in_path(command);
if (exec_path)
{
GError *err = NULL;
+ const gchar *argv[6]; // max args + 1
+ gint argc = 0;
+ argv[argc++] = exec_path;
if (is_osx_bundle())
{
- const gchar *const osx_argv[] = {exec_path, "-n", "-a", "Geany", doc_path, NULL};
- argv = osx_argv;
+ argv[argc++] = "-n";
+ argv[argc++] = "-a";
+ argv[argc++] = "Geany";
+ argv[argc++] = doc_path;
}
else
{
- const gchar *const unix_argv[] = {exec_path, "-i", doc_path, NULL};
- argv = unix_argv;
+ argv[argc++] = "-i";
+ argv[argc++] = doc_path;
}
+ argv[argc] = NULL;
if (!utils_spawn_async(NULL, (gchar**) argv, NULL, 0, NULL, NULL, NULL, &err))
{
Please sign in to comment.
Something went wrong with that request. Please try again.