From de0452f2ed4520c48fcd30e3999a044844b89f37 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 28 Jul 2005 00:01:44 +0000 Subject: * drop trailing dot in avahi_normalize_name() git-svn-id: file:///home/lennart/svn/public/avahi/trunk@180 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-common/rr.c | 1 - avahi-common/util.c | 9 ++++----- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'avahi-common') diff --git a/avahi-common/rr.c b/avahi-common/rr.c index 2a25321..c510e7f 100644 --- a/avahi-common/rr.c +++ b/avahi-common/rr.c @@ -182,7 +182,6 @@ const gchar *avahi_dns_type_to_string(guint16 type) { } } - gchar *avahi_key_to_string(const AvahiKey *k) { g_assert(k); g_assert(k->ref >= 1); diff --git a/avahi-common/util.c b/avahi-common/util.c index c9a3143..8be7b88 100644 --- a/avahi-common/util.c +++ b/avahi-common/util.c @@ -84,13 +84,12 @@ gchar *avahi_normalize_name(const gchar *s) { unescape_uneeded(s, tmp, sizeof(tmp)); - if ((l = strlen(tmp)) == 0) - return g_strdup("."); + l = strlen(tmp); - if (tmp[l-1] == '.') - return g_strdup(tmp); + while (l > 0 && tmp[l-1] == '.') + tmp[--l] = 0; - return g_strdup_printf("%s.", tmp); + return g_strdup(tmp); } gint avahi_timeval_compare(const GTimeVal *a, const GTimeVal *b) { -- cgit