diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-07-28 00:01:44 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-07-28 00:01:44 +0000 |
commit | de0452f2ed4520c48fcd30e3999a044844b89f37 (patch) | |
tree | df9104ce776188e0d0a25ddcc4c8d92276d437ee /avahi-common/util.c | |
parent | 8f1c6544deb351d9df51114c7f6e5f25e026f73e (diff) |
* drop trailing dot in avahi_normalize_name()
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@180 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-common/util.c')
-rw-r--r-- | avahi-common/util.c | 9 |
1 files changed, 4 insertions, 5 deletions
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) { |