[gnome-commander] src/ls_colors.cc: fix for -Wwrite-strings
- From: Uwe Scholz <uwescholz src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gnome-commander] src/ls_colors.cc: fix for -Wwrite-strings
 
- Date: Fri, 28 Apr 2017 21:44:34 +0000 (UTC)
 
commit bd8d3c2392df5c9856c3ad109e1bdee113319997
Author: Mamoru TASAKA <mtasaka fedoraproject org>
Date:   Tue Apr 25 14:35:47 2017 +0900
    src/ls_colors.cc: fix for -Wwrite-strings
    
    src/ls_colors.cc:33:24: error: ISO C++ forbids converting a string constant to 'gchar* {aka char*}' 
[-Werror=write-strings]
    
    Add const correctly.
 src/ls_colors.cc |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/ls_colors.cc b/src/ls_colors.cc
index 32c3c5e..8abd107 100644
--- a/src/ls_colors.cc
+++ b/src/ls_colors.cc
@@ -165,7 +165,7 @@ static LsColor *create_color (gchar *ls_color)
 }
 
 
-static void init (gchar *ls_colors)
+static void init (const gchar *ls_colors)
 {
     gchar **ents = g_strsplit (ls_colors, ":", 0);
 
@@ -191,7 +191,7 @@ static void init (gchar *ls_colors)
 
 void ls_colors_init ()
 {
-    gchar *s = getenv ("LS_COLORS");
+    const gchar *s = getenv ("LS_COLORS");
     if (!s)
         s = DEFAULT_COLORS;
 
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]