Blame SOURCES/paps-0.6.6-lcnumeric.patch

8ae51f
diff -ruN paps-0.6.6.orig/src/libpaps.c paps-0.6.6/src/libpaps.c
8ae51f
--- paps-0.6.6.orig/src/libpaps.c	2007-03-27 20:25:00.000000000 +0900
8ae51f
+++ paps-0.6.6/src/libpaps.c	2007-03-27 20:31:15.000000000 +0900
8ae51f
@@ -28,6 +28,7 @@
8ae51f
 #include <freetype/ftglyph.h>
8ae51f
 #include <freetype/ftoutln.h>
8ae51f
 #include <errno.h>
8ae51f
+#include <locale.h>
8ae51f
 #include <stdlib.h>
8ae51f
 #include <stdio.h>
8ae51f
 #include <string.h>
8ae51f
@@ -263,7 +264,7 @@
8ae51f
 			 );
8ae51f
   
8ae51f
   /* Outline support */
8ae51f
-  g_string_append_printf(paps->header,
8ae51f
+  paps_string_append_printf(paps->header,
8ae51f
 			 "/conicto {\n"
8ae51f
 			 "    /to_y exch def\n"
8ae51f
 			 "    /to_x exch def\n"
8ae51f
@@ -691,3 +692,28 @@
8ae51f
   return points * 1.0 / 72 * PAPS_DPI * PANGO_SCALE;
8ae51f
 }
8ae51f
 
8ae51f
+void
8ae51f
+paps_string_append_printf(GString *string,
8ae51f
+			  const gchar *fmt,
8ae51f
+			  ...)
8ae51f
+{
8ae51f
+	gchar *buffer, *lc_numeric;
8ae51f
+	gint length;
8ae51f
+	va_list args;
8ae51f
+
8ae51f
+	va_start(args, fmt);
8ae51f
+
8ae51f
+	lc_numeric = g_strdup(setlocale(LC_NUMERIC, NULL));
8ae51f
+	setlocale(LC_NUMERIC, "C");
8ae51f
+
8ae51f
+	length = g_vasprintf(&buffer, fmt, args);
8ae51f
+	g_string_append_len(string, buffer, length);
8ae51f
+
8ae51f
+	setlocale(LC_NUMERIC, lc_numeric);
8ae51f
+
8ae51f
+	g_free(buffer);
8ae51f
+	g_free(lc_numeric);
8ae51f
+
8ae51f
+	va_end(args);
8ae51f
+}
8ae51f
+
8ae51f
diff -ruN paps-0.6.6.orig/src/libpaps.h paps-0.6.6/src/libpaps.h
8ae51f
--- paps-0.6.6.orig/src/libpaps.h	2007-03-27 20:25:00.000000000 +0900
8ae51f
+++ paps-0.6.6/src/libpaps.h	2007-03-27 20:31:02.000000000 +0900
8ae51f
@@ -124,4 +124,8 @@
8ae51f
  */
8ae51f
 double paps_postscript_points_to_pango(double points);
8ae51f
 
8ae51f
+void paps_string_append_printf(GString *string,
8ae51f
+			       const gchar *fmt,
8ae51f
+			       ...) G_GNUC_PRINTF (2, 3);
8ae51f
+
8ae51f
 #endif /* LIBPAPS */
8ae51f
diff -ruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c
8ae51f
--- paps-0.6.6.orig/src/paps.c	2007-03-27 20:25:00.000000000 +0900
8ae51f
+++ paps-0.6.6/src/paps.c	2007-03-27 20:31:33.000000000 +0900
8ae51f
@@ -992,7 +992,7 @@
8ae51f
   y_top = page_layout->page_height - page_layout->top_margin - page_layout->header_height - page_layout->header_sep / 2;
8ae51f
   y_bot = page_layout->bottom_margin - page_layout->footer_height;
8ae51f
 
8ae51f
-  g_string_append_printf(ps_pages_string,
8ae51f
+  paps_string_append_printf(ps_pages_string,
8ae51f
                          "%f %f moveto %f %f lineto 0 setlinewidth stroke\n",
8ae51f
                          x_pos, y_top,
8ae51f
                          x_pos, y_bot);
8ae51f
@@ -1154,7 +1154,7 @@
8ae51f
 
8ae51f
   /* header separator */
8ae51f
   line_pos = page_layout->page_height - page_layout->top_margin - page_layout->header_height - page_layout->header_sep / 2;
8ae51f
-  g_string_append_printf(ps_pages_string,
8ae51f
+  paps_string_append_printf(ps_pages_string,
8ae51f
                          "%d %f moveto %d %f lineto 0 setlinewidth stroke\n",
8ae51f
                          page_layout->left_margin, line_pos,
8ae51f
                          page_layout->page_width - page_layout->right_margin, line_pos);