+2001-02-09 Havoc Pennington <hp@redhat.com>
+
+ * gconvert.c (g_convert): don't overwrite errors
+
+ * gerror.c (g_set_error): improve warning message if an error is
+ overwritten
+ (g_propagate_error): ditto
+
2001-02-13 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gthread.c, gthread.h: Added functions g_static_rec_mutex_init,
+2001-02-09 Havoc Pennington <hp@redhat.com>
+
+ * gconvert.c (g_convert): don't overwrite errors
+
+ * gerror.c (g_set_error): improve warning message if an error is
+ overwritten
+ (g_propagate_error): ditto
+
2001-02-13 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gthread.c, gthread.h: Added functions g_static_rec_mutex_init,
+2001-02-09 Havoc Pennington <hp@redhat.com>
+
+ * gconvert.c (g_convert): don't overwrite errors
+
+ * gerror.c (g_set_error): improve warning message if an error is
+ overwritten
+ (g_propagate_error): ditto
+
2001-02-13 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gthread.c, gthread.h: Added functions g_static_rec_mutex_init,
+2001-02-09 Havoc Pennington <hp@redhat.com>
+
+ * gconvert.c (g_convert): don't overwrite errors
+
+ * gerror.c (g_set_error): improve warning message if an error is
+ overwritten
+ (g_propagate_error): ditto
+
2001-02-13 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gthread.c, gthread.h: Added functions g_static_rec_mutex_init,
+2001-02-09 Havoc Pennington <hp@redhat.com>
+
+ * gconvert.c (g_convert): don't overwrite errors
+
+ * gerror.c (g_set_error): improve warning message if an error is
+ overwritten
+ (g_propagate_error): ditto
+
2001-02-13 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gthread.c, gthread.h: Added functions g_static_rec_mutex_init,
+2001-02-09 Havoc Pennington <hp@redhat.com>
+
+ * gconvert.c (g_convert): don't overwrite errors
+
+ * gerror.c (g_set_error): improve warning message if an error is
+ overwritten
+ (g_propagate_error): ditto
+
2001-02-13 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gthread.c, gthread.h: Added functions g_static_rec_mutex_init,
+2001-02-09 Havoc Pennington <hp@redhat.com>
+
+ * gconvert.c (g_convert): don't overwrite errors
+
+ * gerror.c (g_set_error): improve warning message if an error is
+ overwritten
+ (g_propagate_error): ditto
+
2001-02-13 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gthread.c, gthread.h: Added functions g_static_rec_mutex_init,
+2001-02-09 Havoc Pennington <hp@redhat.com>
+
+ * gconvert.c (g_convert): don't overwrite errors
+
+ * gerror.c (g_set_error): improve warning message if an error is
+ overwritten
+ (g_propagate_error): ditto
+
2001-02-13 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gthread.c, gthread.h: Added functions g_static_rec_mutex_init,
{
if ((p - str) != len)
{
- g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT,
- _("Partial character sequence at end of input"));
- have_error = TRUE;
+ if (!have_error)
+ {
+ g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT,
+ _("Partial character sequence at end of input"));
+ have_error = TRUE;
+ }
}
}
else
g_error_free (local_error);
+ local_error = NULL;
+
/* No go; to proceed, we need a converter from "UTF-8" to
* to_codeset, and the string as UTF-8.
*/
}
#define ERROR_OVERWRITTEN_WARNING "GError set over the top of a previous GError or uninitialized memory.\n" \
- "This indicates a bug in someone's code. You must ensure an error is NULL before it's set."
+ "This indicates a bug in someone's code. You must ensure an error is NULL before it's set.\n" \
+ "The overwriting error message was: %s"
/**
* g_set_error:
const gchar *format,
...)
{
+ GError *new;
+
va_list args;
if (err == NULL)
return;
-
- if (*err != NULL)
- g_warning (ERROR_OVERWRITTEN_WARNING);
va_start (args, format);
- *err = g_error_new_valist (domain, code, format, args);
+ new = g_error_new_valist (domain, code, format, args);
va_end (args);
+
+ if (*err == NULL)
+ *err = new;
+ else
+ g_warning (ERROR_OVERWRITTEN_WARNING, new->message);
}
/**
else
{
if (*dest != NULL)
- g_warning (ERROR_OVERWRITTEN_WARNING);
-
- *dest = src;
+ g_warning (ERROR_OVERWRITTEN_WARNING, src->message);
+ else
+ *dest = src;
}
}
{
if ((p - str) != len)
{
- g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT,
- _("Partial character sequence at end of input"));
- have_error = TRUE;
+ if (!have_error)
+ {
+ g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT,
+ _("Partial character sequence at end of input"));
+ have_error = TRUE;
+ }
}
}
else
g_error_free (local_error);
+ local_error = NULL;
+
/* No go; to proceed, we need a converter from "UTF-8" to
* to_codeset, and the string as UTF-8.
*/
}
#define ERROR_OVERWRITTEN_WARNING "GError set over the top of a previous GError or uninitialized memory.\n" \
- "This indicates a bug in someone's code. You must ensure an error is NULL before it's set."
+ "This indicates a bug in someone's code. You must ensure an error is NULL before it's set.\n" \
+ "The overwriting error message was: %s"
/**
* g_set_error:
const gchar *format,
...)
{
+ GError *new;
+
va_list args;
if (err == NULL)
return;
-
- if (*err != NULL)
- g_warning (ERROR_OVERWRITTEN_WARNING);
va_start (args, format);
- *err = g_error_new_valist (domain, code, format, args);
+ new = g_error_new_valist (domain, code, format, args);
va_end (args);
+
+ if (*err == NULL)
+ *err = new;
+ else
+ g_warning (ERROR_OVERWRITTEN_WARNING, new->message);
}
/**
else
{
if (*dest != NULL)
- g_warning (ERROR_OVERWRITTEN_WARNING);
-
- *dest = src;
+ g_warning (ERROR_OVERWRITTEN_WARNING, src->message);
+ else
+ *dest = src;
}
}