Merged fix from gimp-1-2:

2001-01-09  Sven Neumann  <sven@gimp.org>

	Merged fix from gimp-1-2:

	* app/gimpbrushlist.c
	* app/gradient.c
	* app/palette.c
	* app/patterns.c: check for NULL pointers before doing strcmp on
	default names. The default names for brushes, patterns, ... can
	be NULL if they were not set in a readable gimprc file.

	* app/gimprc.c: warn the user if the systemwide gimprc couldn't be
	read.
This commit is contained in:
Sven Neumann 2001-01-09 22:36:39 +00:00 committed by Sven Neumann
parent d52c61a717
commit c935ec8367
11 changed files with 42 additions and 8 deletions

View File

@ -1,3 +1,17 @@
2001-01-09 Sven Neumann <sven@gimp.org>
Merged fix from gimp-1-2:
* app/gimpbrushlist.c
* app/gradient.c
* app/palette.c
* app/patterns.c: check for NULL pointers before doing strcmp on
default names. The default names for brushes, patterns, ... can
be NULL if they were not set in a readable gimprc file.
* app/gimprc.c: warn the user if the systemwide gimprc couldn't be
read.
2001-01-09 Michael Natterer <mitch@gimp.org>
* app/color_notebook.c: Show the "Alpha" scale only when needed.

View File

@ -453,12 +453,12 @@ gimp_brush_list_get_brush (GimpBrushList *blist,
gchar *name)
{
GimpBrush *brushp;
GSList *list;
GSList *list;
if (blist == NULL)
if (blist == NULL || name == NULL)
return NULL;
for (list = GIMP_LIST (brush_list)->list; list; list = g_slist_next (list))
for (list = GIMP_LIST (blist)->list; list; list = g_slist_next (list))
{
brushp = (GimpBrush *) list->data;
@ -468,3 +468,4 @@ gimp_brush_list_get_brush (GimpBrushList *blist,
return NULL;
}

View File

@ -426,8 +426,9 @@ parse_gimprc (void)
else
libfilename = g_strdup (gimp_system_rc_file ());
parse_gimprc_file (libfilename);
if (! parse_gimprc_file (libfilename))
g_message ("Can't open '%s' for reading.", libfilename);
if (alternate_gimprc != NULL)
filename = g_strdup (alternate_gimprc);
else

View File

@ -702,6 +702,9 @@ gradient_list_get_gradient (GSList *list,
{
gradient_t *gradient;
if (name == NULL)
return NULL;
for (; list; list = g_slist_next (list))
{
gradient = (gradient_t *) list->data;

View File

@ -702,6 +702,9 @@ gradient_list_get_gradient (GSList *list,
{
gradient_t *gradient;
if (name == NULL)
return NULL;
for (; list; list = g_slist_next (list))
{
gradient = (gradient_t *) list->data;

View File

@ -702,6 +702,9 @@ gradient_list_get_gradient (GSList *list,
{
gradient_t *gradient;
if (name == NULL)
return NULL;
for (; list; list = g_slist_next (list))
{
gradient = (gradient_t *) list->data;

View File

@ -482,7 +482,8 @@ palette_entries_load (gchar *filename)
palette_entries_list_insert (entries);
/* Check if the current palette is the default one */
if (strcmp (default_palette, g_basename (filename)) == 0)
if (default_palette &&
strcmp (default_palette, g_basename (filename)) == 0)
default_palette_entries = entries;
}

View File

@ -482,7 +482,8 @@ palette_entries_load (gchar *filename)
palette_entries_list_insert (entries);
/* Check if the current palette is the default one */
if (strcmp (default_palette, g_basename (filename)) == 0)
if (default_palette &&
strcmp (default_palette, g_basename (filename)) == 0)
default_palette_entries = entries;
}

View File

@ -158,6 +158,9 @@ pattern_list_get_pattern (GSList *list,
{
GPattern *pattern;
if (name == NULL)
return NULL;
for (; list; list = g_slist_next (list))
{
pattern = (GPattern *) list->data;

View File

@ -702,6 +702,9 @@ gradient_list_get_gradient (GSList *list,
{
gradient_t *gradient;
if (name == NULL)
return NULL;
for (; list; list = g_slist_next (list))
{
gradient = (gradient_t *) list->data;

View File

@ -482,7 +482,8 @@ palette_entries_load (gchar *filename)
palette_entries_list_insert (entries);
/* Check if the current palette is the default one */
if (strcmp (default_palette, g_basename (filename)) == 0)
if (default_palette &&
strcmp (default_palette, g_basename (filename)) == 0)
default_palette_entries = entries;
}