From 7d931c845ebde4aa472835708e5c9ac4e66666b0 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Thu, 15 Aug 2013 07:55:20 -0400 Subject: [PATCH 1/2] Fix annotation for xdg_mime_list_parents There is a fatal crash in Sugar when retrieving mimetypes for some Journal entries when contructing the icon palette (for both the Journal list view and detail view). We isolated the problem to xdgmime.c, the call to xdg_get_mime_parents. Dnarvaez observed that the annotation for the return argument was missing and that the annotation for the return for mime_list_parents was wrong. This patch fixes these annotations. Fixes #4530 --- src/sugar3/xdgmime.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/sugar3/xdgmime.c b/src/sugar3/xdgmime.c index ec8a6a30..9d51bc8a 100644 --- a/src/sugar3/xdgmime.c +++ b/src/sugar3/xdgmime.c @@ -762,7 +762,7 @@ xdg_mime_mime_type_subclass (const char *mime, /** * sugar_mime_list_mime_parents: * - * Return value: (array zero-terminated=1) (transfer full): + * Return value: (transfer container): **/ char ** xdg_mime_list_mime_parents (const char *mime) @@ -788,6 +788,11 @@ xdg_mime_list_mime_parents (const char *mime) return result; } +/** + * sugar_mime_get_mime_parents: + * + * Return value: (transfer none): + **/ const char ** xdg_mime_get_mime_parents (const char *mime) { From ba8c435e5091c601820d6d08e7def119b0c8d3c3 Mon Sep 17 00:00:00 2001 From: Martin Abente Lahaye Date: Thu, 15 Aug 2013 17:08:22 -0400 Subject: [PATCH 2/2] Include string.h to sugar-fatattr According to dsd's wisdom, without being included, strerror is undeclared. Fixes #4600 sugar crashing when copying journal entries to documents folder. Signed-off-by: Martin Abente Lahaye --- src/sugar3/sugar-fatattr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sugar3/sugar-fatattr.c b/src/sugar3/sugar-fatattr.c index 40a6ee8d..a7c2a1dc 100644 --- a/src/sugar3/sugar-fatattr.c +++ b/src/sugar3/sugar-fatattr.c @@ -30,6 +30,7 @@ #include #include +#include // This function is wrapped by getattrs/setattrs static int _ioctl_attrs(char *file, __u32 *attrs, int ioctlnum, char *verb)