summaryrefslogtreecommitdiff
path: root/libmate-desktop/mate-desktop-utils.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-01-10 14:03:07 +0100
committerRobert Antoni Buj Gelonch <[email protected]>2021-02-08 22:34:03 +0100
commit44193bc230d11676c8a2ae247f819deaaebb82c0 (patch)
treebb9275c76f93357954790870e8765bc0d29945fb /libmate-desktop/mate-desktop-utils.c
parentb3be7952074144fe4077ab12780b5bacb853729a (diff)
downloadmate-desktop-44193bc230d11676c8a2ae247f819deaaebb82c0.tar.bz2
mate-desktop-44193bc230d11676c8a2ae247f819deaaebb82c0.tar.xz
g_settings_get_string always returns a newly-allocated string
Diffstat (limited to 'libmate-desktop/mate-desktop-utils.c')
-rw-r--r--libmate-desktop/mate-desktop-utils.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libmate-desktop/mate-desktop-utils.c b/libmate-desktop/mate-desktop-utils.c
index b86253e..a5228b7 100644
--- a/libmate-desktop/mate-desktop-utils.c
+++ b/libmate-desktop/mate-desktop-utils.c
@@ -75,7 +75,7 @@ mate_desktop_prepend_terminal_to_vector (int *argc, char ***argv)
int term_argc = 0;
GSettings *settings;
- gchar *terminal = NULL;
+ gchar *terminal;
char **the_argv;
@@ -100,12 +100,13 @@ mate_desktop_prepend_terminal_to_vector (int *argc, char ***argv)
settings = g_settings_new ("org.mate.applications-terminal");
terminal = g_settings_get_string (settings, "exec");
- if (terminal) {
+ if (terminal && *terminal != '\0') {
gchar *command_line;
gchar *exec_flag;
+
exec_flag = g_settings_get_string (settings, "exec-arg");
- if (exec_flag == NULL)
+ if (!exec_flag || *exec_flag == '\0')
command_line = g_strdup (terminal);
else
command_line = g_strdup_printf ("%s %s", terminal,
@@ -118,8 +119,8 @@ mate_desktop_prepend_terminal_to_vector (int *argc, char ***argv)
g_free (command_line);
g_free (exec_flag);
- g_free (terminal);
}
+ g_free (terminal);
g_object_unref (settings);
if (term_argv == NULL) {