[geocode-glib] geocode-glib: Fix const-correctness issues with user-agent handling
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geocode-glib] geocode-glib: Fix const-correctness issues with user-agent handling
- Date: Tue, 17 Jan 2017 17:00:50 +0000 (UTC)
commit 9acd6a0fa1051d97e2d8d010e4d41beca86875c9
Author: Philip Withnall <withnall endlessm com>
Date: Tue Jan 17 17:00:13 2017 +0000
geocode-glib: Fix const-correctness issues with user-agent handling
geocode-glib/geocode-glib.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/geocode-glib/geocode-glib.c b/geocode-glib/geocode-glib.c
index 1d92e34..fdd9ceb 100644
--- a/geocode-glib/geocode-glib.c
+++ b/geocode-glib/geocode-glib.c
@@ -40,7 +40,7 @@
SoupSession *
_geocode_glib_build_soup_session (const gchar *user_agent_override)
{
- char *user_agent;
+ const char *user_agent;
g_autofree gchar *user_agent_allocated = NULL;
if (user_agent_override != NULL) {
@@ -48,18 +48,18 @@ _geocode_glib_build_soup_session (const gchar *user_agent_override)
} else if (g_application_get_default () != NULL) {
GApplication *application = g_application_get_default ();
const char *id = g_application_get_application_id (application);
- user_agent = g_strdup_printf ("geocode-glib/%s (%s)",
- PACKAGE_VERSION, id);
- user_agent_allocated = user_agent;
+ user_agent_allocated = g_strdup_printf ("geocode-glib/%s (%s)",
+ PACKAGE_VERSION, id);
+ user_agent = user_agent_allocated;
} else if (g_get_application_name () != NULL) {
- user_agent = g_strdup_printf ("geocode-glib/%s (%s)",
- PACKAGE_VERSION,
- g_get_application_name ());
- user_agent_allocated = user_agent;
+ user_agent_allocated = g_strdup_printf ("geocode-glib/%s (%s)",
+ PACKAGE_VERSION,
+ g_get_application_name ());
+ user_agent = user_agent_allocated;
} else {
- user_agent = g_strdup_printf ("geocode-glib/%s",
- PACKAGE_VERSION);
- user_agent_allocated = user_agent;
+ user_agent_allocated = g_strdup_printf ("geocode-glib/%s",
+ PACKAGE_VERSION);
+ user_agent = user_agent_allocated;
}
g_debug ("%s: user_agent = %s", G_STRFUNC, user_agent);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]