Install a printerr handler that prepends the program name, since

2008-02-05  Matthias Clasen  <mclasen@redhat.com>

        * gtk/updateiconcache.c: Install a printerr handler that
        prepends the program name, since gtk-update-icon-cache output
        often appears in the middle of other output, e.g. rpm update logs.


svn path=/trunk/; revision=19464
This commit is contained in:
Matthias Clasen 2008-02-05 18:35:54 +00:00 committed by Matthias Clasen
parent db58254c5c
commit c4be17ba1b
2 changed files with 28 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2008-02-05 Matthias Clasen <mclasen@redhat.com>
* gtk/updateiconcache.c: Install a printerr handler that
prepends the program name, since gtk-update-icon-cache output
often appears in the middle of other output, e.g. rpm update logs.
2008-02-05 Cody Russell <bratsche@gnome.org>
* gdk/win32/gdkprivate-win32.h

View File

@ -1575,6 +1575,26 @@ static GOptionEntry args[] = {
{ NULL }
};
static void
printerr_handler (const gchar *string)
{
const gchar *charset;
fputs (g_get_prgname (), stderr);
fputs (": ", stderr);
if (g_get_charset (&charset))
fputs (string, stderr); /* charset is UTF-8 already */
else
{
gchar *lstring = strdup_convert (string, charset);
fputs (lstring, stderr);
g_free (lstring);
fflush (stderr);
}
}
int
main (int argc, char **argv)
{
@ -1583,6 +1603,8 @@ main (int argc, char **argv)
if (argc < 2)
return 0;
g_set_printerr_handler (printerr_handler);
setlocale (LC_ALL, "");