summaryrefslogtreecommitdiff
path: root/mate-panel/libpanel-util/panel-keyfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'mate-panel/libpanel-util/panel-keyfile.c')
-rw-r--r--mate-panel/libpanel-util/panel-keyfile.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/mate-panel/libpanel-util/panel-keyfile.c b/mate-panel/libpanel-util/panel-keyfile.c
index e7745501..b98058c3 100644
--- a/mate-panel/libpanel-util/panel-keyfile.c
+++ b/mate-panel/libpanel-util/panel-keyfile.c
@@ -2,6 +2,7 @@
* panel-keyfile.c: GKeyFile extensions
*
* Copyright (C) 2008 Novell, Inc.
+ * Copyright (C) 2012-2021 MATE Developers
*
* Based on code from panel-util.c (there was no copyright header at the time)
*
@@ -52,8 +53,6 @@ _panel_key_file_make_executable (const gchar *path)
{
GFile *file;
GFileInfo *info;
- guint32 current_perms;
- guint32 new_perms;
file = g_file_new_for_path (path);
@@ -71,6 +70,9 @@ _panel_key_file_make_executable (const gchar *path)
}
if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_UNIX_MODE)) {
+ guint32 current_perms;
+ guint32 new_perms;
+
current_perms = g_file_info_get_attribute_uint32 (info,
G_FILE_ATTRIBUTE_UNIX_MODE);
new_perms = current_perms | S_IXGRP | S_IXUSR | S_IXOTH;
@@ -292,8 +294,7 @@ panel_key_file_remove_locale_key (GKeyFile *keyfile,
locale_key, NULL))
break;
- g_free (locale_key);
- locale_key = NULL;
+ g_clear_pointer (&locale_key, g_free);
}
}
@@ -341,18 +342,15 @@ panel_key_file_remove_all_locale_key (GKeyFile *keyfile,
void
panel_key_file_ensure_C_key (GKeyFile *keyfile,
- const char *key)
+ const char *key)
{
- char *C_value;
- char *buffer;
-
/* Make sure we set the "C" locale strings to the terms we set here.
* This is so that if the user logs into another locale they get their
* own description there rather then empty. It is not the C locale
* however, but the user created this entry herself so it's OK */
- C_value = panel_key_file_get_string (keyfile, key);
+ char *C_value = panel_key_file_get_string (keyfile, key);
if (C_value == NULL || C_value [0] == '\0') {
- buffer = panel_key_file_get_locale_string (keyfile, key);
+ char *buffer = panel_key_file_get_locale_string (keyfile, key);
if (buffer) {
panel_key_file_set_string (keyfile, key, buffer);
g_free (buffer);