can't assign the return value of g_strdupv() to an array. Fill the array

2008-09-16  Michael Natterer  <mitch@imendio.com>

	* gcontenttype.c (g_content_type_guess): can't assign the return
	value of g_strdupv() to an array. Fill the array manually with
	const strings instead (it is never freed anyway). Fixes the
	build. Also fixed indentation.


svn path=/trunk/; revision=7501
This commit is contained in:
Michael Natterer 2008-09-16 11:36:52 +00:00 committed by Michael Natterer
parent 1d627b703f
commit 2623f6fc0f
2 changed files with 21 additions and 11 deletions

View File

@ -1,3 +1,10 @@
2008-09-16 Michael Natterer <mitch@imendio.com>
* gcontenttype.c (g_content_type_guess): can't assign the return
value of g_strdupv() to an array. Fill the array manually with
const strings instead (it is never freed anyway). Fixes the
build. Also fixed indentation.
2008-09-16 Wouter Bolsterlee <wbolster@svn.gnome.org>
* gdesktopappinfo.c (g_desktop_app_info_new_from_keyfile):

View File

@ -896,17 +896,20 @@ g_content_type_guess (const char *filename,
if (filename)
{
i = strlen (filename);
if (filename[i - 1] == '/') {
char *mimetypes[] = { "inode/directory", NULL };
name_mimetypes = g_strdupv (mimetypes);
n_name_mimetypes = 1;
if (result_uncertain)
*result_uncertain = TRUE;
} else {
basename = g_path_get_basename (filename);
n_name_mimetypes = xdg_mime_get_mime_types_from_file_name (basename, name_mimetypes, 10);
g_free (basename);
}
if (filename[i - 1] == '/')
{
name_mimetypes[0] = "inode/directory";
name_mimetypes[1] = NULL;
n_name_mimetypes = 1;
if (result_uncertain)
*result_uncertain = TRUE;
}
else
{
basename = g_path_get_basename (filename);
n_name_mimetypes = xdg_mime_get_mime_types_from_file_name (basename, name_mimetypes, 10);
g_free (basename);
}
}
/* Got an extension match, and no conflicts. This is it. */