Blame SOURCES/paps-0.6.6-lcnumeric.patch

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