approved.
Takao Fujiwara - Tokyo S/W Center wrote:
> Attached the upstreamed patch.
> One is to avoid crashes with the localize filenames. Another is to output 
> localized filenames.
>
> bugzilla: 361876 and 324150
> bugster: 6452832 and 6245399
>   
> ------------------------------------------------------------------------
>
> --- libgnomeprint-2.12.1/libgnomeprint/gnome-print-job.c.orig 2006-11-16 
> 21:26:01.451594000 +0900
> +++ libgnomeprint-2.12.1/libgnomeprint/gnome-print-job.c      2006-11-16 
> 21:27:38.675795000 +0900
> @@ -634,7 +634,11 @@ gnome_print_job_print (GnomePrintJob *jo
>               nsheets = copies;
>       }
>  
> -     npages = (lpages + job->priv->num_affines - 1) / job->priv->num_affines;
> +     if (job->priv->num_affines >= 1) {
> +             npages = (lpages + job->priv->num_affines - 1) / 
> job->priv->num_affines;
> +     } else {
> +             npages = 0;
> +     }
>       for (stack = 0; stack < nstacks; stack++) {
>               gint page;
>               for (page = 0; page < npages; page++) {
> --- libgnomeprint-2.12.1/libgnomeprint/transports/gp-transport-file.c.orig    
> 2006-11-16 21:30:07.891802000 +0900
> +++ libgnomeprint-2.12.1/libgnomeprint/transports/gp-transport-file.c 
> 2006-11-16 21:33:01.881732000 +0900
> @@ -150,6 +150,7 @@ static gint
>  gp_transport_file_open (GnomePrintTransport *transport)
>  {
>       GPTransportFile *tf;
> +     gchar *sys_filename = NULL;
>  
>       tf = GP_TRANSPORT_FILE (transport);
>  
> @@ -158,7 +159,10 @@ gp_transport_file_open (GnomePrintTransp
>  #if defined(G_OS_WIN32) && (defined(__MINGW32__) || defined _MSC_VER)
>       tf->fd = open (tf->name, O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 
> _S_IREAD | _S_IWRITE);
>  #else
> -     tf->fd = open (tf->name, O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 
> S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
> +     sys_filename = g_filename_from_utf8 ((const gchar*)tf->name, -1, NULL, 
> NULL, NULL);
> +     g_return_val_if_fail (sys_filename != NULL, GNOME_PRINT_ERROR_UNKNOWN);
> +     tf->fd = open (sys_filename, O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 
> S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
> +     g_free (sys_filename);
>  #endif
>  
>       if (tf->fd < 0) {
>   


Reply via email to