Applied upstream patches to rsvg-convert

This commit is contained in:
Joel Holdsworth 2008-11-15 16:32:29 +00:00
parent 6c50182db1
commit ab8edcdedd

View file

@ -35,6 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
#include <librsvg-2/librsvg/rsvg.h>
#include <librsvg-2/librsvg/rsvg-cairo.h>
@ -71,7 +72,7 @@ static void
display_error (GError * err)
{
if (err) {
g_print ("%s", err->message);
g_print ("%s\n", err->message);
g_error_free (err);
}
}
@ -87,8 +88,9 @@ rsvg_cairo_size_callback (int *width, int *height, gpointer data)
static cairo_status_t
rsvg_cairo_write_func (void *closure, const unsigned char *data, unsigned int length)
{
fwrite (data, 1, length, (FILE *) closure);
return CAIRO_STATUS_SUCCESS;
if (fwrite (data, 1, length, (FILE *) closure) == length)
return CAIRO_STATUS_SUCCESS;
return CAIRO_STATUS_WRITE_ERROR;
}
int
@ -124,6 +126,9 @@ main (int argc, char **argv)
{NULL}
};
/* Set the locale so that UTF-8 filenames work */
setlocale(LC_ALL, "");
g_thread_init(NULL);
g_option_context = g_option_context_new (_("- SVG Converter"));