summaryrefslogtreecommitdiff
path: root/daemon/gvfsafpserver.c
diff options
context:
space:
mode:
authorCarl-Anton Ingmarsson <ca.ingmarsson@gmail.com>2011-06-20 12:52:14 +0200
committerChristian Kellner <gicmo@gnome.org>2011-08-25 21:18:39 +0200
commitaec7c42dc109e3cf19cfbe25c0a2b1aa6d56e8b0 (patch)
tree0c14eec333e56aa46ca2bc0fabfd141356b0c4db /daemon/gvfsafpserver.c
parent4b505fd08dd144dc3393833ff83bcd2207568ff9 (diff)
downloadgvfs-aec7c42dc109e3cf19cfbe25c0a2b1aa6d56e8b0.tar.gz
afp: use UTF-8 ServerName if available
Diffstat (limited to 'daemon/gvfsafpserver.c')
-rw-r--r--daemon/gvfsafpserver.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/daemon/gvfsafpserver.c b/daemon/gvfsafpserver.c
index 504e25c6..d76b8f01 100644
--- a/daemon/gvfsafpserver.c
+++ b/daemon/gvfsafpserver.c
@@ -695,13 +695,16 @@ get_server_info (GVfsAfpServer *afp_serv,
/* Parse UTF-8 ServerName */
if (afp_serv->flags & (0x1 << 8)) {
guint16 UTF8ServerName_offset;
+ GVfsAfpName *utf8_server_name;
g_vfs_afp_reply_skip_to_even (reply);
g_vfs_afp_reply_seek (reply, 6, G_SEEK_CUR);
g_vfs_afp_reply_read_uint16 (reply, &UTF8ServerName_offset);
g_vfs_afp_reply_seek (reply, UTF8ServerName_offset, G_SEEK_SET);
- g_vfs_afp_reply_read_afp_name (reply, FALSE, &afp_serv->utf8_server_name);
+ g_vfs_afp_reply_read_afp_name (reply, FALSE, &utf8_server_name);
+ afp_serv->utf8_server_name = g_vfs_afp_name_get_string (utf8_server_name);
+ g_vfs_afp_name_unref (utf8_server_name);
}
/* Parse MachineType */
@@ -942,8 +945,7 @@ g_vfs_afp_server_finalize (GObject *object)
g_free (afp_serv->machine_type);
g_free (afp_serv->server_name);
- if (afp_serv->utf8_server_name)
- g_vfs_afp_name_unref (afp_serv->utf8_server_name);
+ g_free (afp_serv->utf8_server_name);
g_slist_free_full (afp_serv->uams, g_free);