Properly separate sorted xattr names

We expect to be handling a string delimited by \0 characters, as
returned by llistxattr(). So stick to that behavior here.

https://bugzilla.gnome.org/show_bug.cgi?id=705893
This commit is contained in:
Stef Walter 2013-08-13 15:40:06 +02:00
parent 0111ec1307
commit c246c4194f
1 changed files with 3 additions and 1 deletions

View File

@ -158,8 +158,10 @@ canonicalize_xattrs (char *xattr_string, size_t len)
}
xattrs = g_slist_sort (xattrs, (GCompareFunc) strcmp);
for (iter = xattrs; iter; iter = iter->next)
for (iter = xattrs; iter; iter = iter->next) {
g_string_append (result, iter->data);
g_string_append_c (result, '\0');
}
g_slist_free (xattrs);
return g_string_free (result, FALSE);