mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
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:
committed by
Michael Natterer
parent
1d627b703f
commit
2623f6fc0f
@@ -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. */
|
||||
|
Reference in New Issue
Block a user