[gnome-desktop] Add const-qualifier when assigning string literals



commit 50299b7330fc3dde069548b12df30db60d0f9eb7
Author: Ernestas Kulik <ernestask gnome org>
Date:   Mon Feb 12 18:52:00 2018 +0200

    Add const-qualifier when assigning string literals
    
    This also requires some casting when using due to legacy requirements.
    The string is never modified, so it’s fine.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=793195

 libgnome-desktop/gnome-languages.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/libgnome-desktop/gnome-languages.c b/libgnome-desktop/gnome-languages.c
index cbf82d3..f6756ba 100644
--- a/libgnome-desktop/gnome-languages.c
+++ b/libgnome-desktop/gnome-languages.c
@@ -509,12 +509,12 @@ static gboolean
 collect_locales_from_localebin (void)
 {
         gboolean found_locales = FALSE;
-        gchar    *argv[] = { "locale", "-a", NULL };
-        gchar    **linep;
+        const gchar *argv[] = { "locale", "-a", NULL };
+        gchar **linep;
         g_auto (GStrv) lines = NULL;
         g_autofree gchar *output = NULL;
 
-        if (g_spawn_sync (NULL, argv, NULL,
+        if (g_spawn_sync (NULL, (gchar **) argv, NULL,
                           G_SPAWN_SEARCH_PATH|G_SPAWN_STDERR_TO_DEV_NULL,
                           NULL, NULL, &output, NULL, NULL, NULL) == FALSE)
                 return FALSE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]