Commit 5cd081a6 authored by Johannes Schmid's avatar Johannes Schmid Committed by Johannes Schmid

Don't crash when language manager returns a NULL list of languages

2009-02-10  Johannes Schmid  <jhs@gnome.org>

	* plugins/sourceview/sourceview.c
	(ilanguage_get_supported_languages):
	Don't crash when language manager returns a NULL list of languages (#570492)

svn path=/trunk/; revision=4731
parent bb658967
2009-02-10 Johannes Schmid <jhs@gnome.org>
* plugins/sourceview/sourceview.c
(ilanguage_get_supported_languages):
Don't crash when language manager returns a NULL list of languages (#570492)
2009-02-10 Johannes Schmid <jhs@gnome.org>
* plugins/sourceview/plugin.c (create_style_model):
......@@ -1887,15 +1887,17 @@ ilanguage_get_supported_languages (IAnjutaEditorLanguage *ilanguage,
static GList* languages = NULL;
if (!languages)
{
GStrv langs;
GStrv lang;
g_object_get (gtk_source_language_manager_get_default(), "language-ids", &langs, NULL);
for (lang = langs; *lang != NULL; lang++)
const gchar* const * langs = gtk_source_language_manager_get_language_ids (gtk_source_language_manager_get_default());
if (langs)
{
languages = g_list_append (languages, *lang);
const gchar* const * lang;
for (lang = langs; *lang != NULL; lang++)
{
languages = g_list_append (languages, (gpointer)*lang);
}
}
}
}
return languages;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment