Commit c935ec83 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

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.
parent d52c61a7
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.
......
......@@ -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;
}
......@@ -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
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
}
......
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