[glib] API: Constify g_get_prgname()



commit 120834db5b1cc735530d2452440ffd8a3b6e48f7
Author: Benjamin Otte <otte redhat com>
Date:   Sun Jan 13 18:14:11 2013 +0100

    API: Constify g_get_prgname()
    
    Found by Mike Gorse while via pygobject freeing the value.
    
    Should have been const according to original commit message.

 glib/gutils.c |    2 +-
 glib/gutils.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/glib/gutils.c b/glib/gutils.c
index de7c3f8..3935d04 100644
--- a/glib/gutils.c
+++ b/glib/gutils.c
@@ -1071,7 +1071,7 @@ static gchar *g_prgname = NULL;
  * Returns: the name of the program. The returned string belongs 
  * to GLib and must not be modified or freed.
  */
-gchar*
+const gchar*
 g_get_prgname (void)
 {
   gchar* retval;
diff --git a/glib/gutils.h b/glib/gutils.h
index 8102f53..bddde24 100644
--- a/glib/gutils.h
+++ b/glib/gutils.h
@@ -89,7 +89,7 @@ const gchar *         g_get_real_name        (void);
 const gchar *         g_get_home_dir         (void);
 const gchar *         g_get_tmp_dir          (void);
 const gchar *         g_get_host_name	     (void);
-gchar *               g_get_prgname          (void);
+const gchar *         g_get_prgname          (void);
 void                  g_set_prgname          (const gchar *prgname);
 const gchar *         g_get_application_name (void);
 void                  g_set_application_name (const gchar *application_name);



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