Skip to content

Commit

Permalink
Altered keyfile.c to use the new spawning module
Browse files Browse the repository at this point in the history
In particular, changed the default printcmd not to "single quote paths
on Win32 for g_spawn_command_line_async", but use the native double
quotes. Also fixed it not to g_strconcat(NULL, ...) if lpr is missing
under Unix. It works, but glib says the first string must not be NULL,
and the command becomes wrong anyway.
  • Loading branch information
zhekov committed Mar 23, 2015
1 parent 6e92c5f commit a3af98c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/keyfile.c
Expand Up @@ -941,19 +941,20 @@ static void load_dialog_prefs(GKeyFile *config)

/* printing */
tmp_string2 = g_find_program_in_path(GEANY_DEFAULT_TOOLS_PRINTCMD);
#ifdef G_OS_WIN32

if (!EMPTY(tmp_string2))
{
/* single quote paths on Win32 for g_spawn_command_line_async */
tmp_string = g_strconcat("'", tmp_string2, "' '%f'", NULL);
#ifdef G_OS_WIN32
tmp_string = g_strconcat(GEANY_DEFAULT_TOOLS_PRINTCMD, " \"%f\"", NULL);
#else
tmp_string = g_strconcat(GEANY_DEFAULT_TOOLS_PRINTCMD, " %f", NULL);
#endif
}
else
{
tmp_string = g_strdup("");
}
#else
tmp_string = g_strconcat(tmp_string2, " %f", NULL);
#endif

printing_prefs.external_print_cmd = utils_get_setting_string(config, "printing", "print_cmd", tmp_string);
g_free(tmp_string);
g_free(tmp_string2);
Expand Down

0 comments on commit a3af98c

Please sign in to comment.