From 3d73139a94cf672566bc865ea6b57034ad29c7a2 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Fri, 29 Sep 2006 14:59:28 +0000 Subject: [PATCH] - Avoid using iconv when not needed (bug #206259). --- paps-cups.patch | 27 +++++++++++++-------------- paps.spec | 5 ++++- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/paps-cups.patch b/paps-cups.patch index f00790b..3d2aa89 100644 --- a/paps-cups.patch +++ b/paps-cups.patch @@ -1,4 +1,3 @@ -diff -ruN paps-0.6.6.orig/configure.in paps-0.6.6/configure.in --- paps-0.6.6.orig/configure.in 2006-09-14 15:04:03.000000000 +0900 +++ paps-0.6.6/configure.in 2006-09-14 14:58:18.000000000 +0900 @@ -7,4 +7,17 @@ @@ -19,7 +18,6 @@ diff -ruN paps-0.6.6.orig/configure.in paps-0.6.6/configure.in +AC_SUBST(CUPS_LIBS) + AC_OUTPUT(Makefile src/Makefile doc/Makefile) -diff -ruN paps-0.6.6.orig/src/Makefile.am paps-0.6.6/src/Makefile.am --- paps-0.6.6.orig/src/Makefile.am 2006-09-14 15:04:03.000000000 +0900 +++ paps-0.6.6/src/Makefile.am 2006-09-14 14:58:18.000000000 +0900 @@ -5,10 +5,10 @@ @@ -35,9 +33,8 @@ diff -ruN paps-0.6.6.orig/src/Makefile.am paps-0.6.6/src/Makefile.am paps_DEPENDENCIES = $(noinst_LIBRARIES) EXTRA_DIST = test_libpaps.c paps.1 -diff -ruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c ---- paps-0.6.6.orig/src/paps.c 2006-09-14 15:04:03.000000000 +0900 -+++ paps-0.6.6/src/paps.c 2006-09-14 15:03:50.000000000 +0900 +--- paps-0.6.6/src/paps.c 2006-09-14 15:03:50.000000000 +0900 ++++ paps-0.6.6/src/paps.c 2006-09-29 15:51:26.000000000 +0100 @@ -31,6 +31,7 @@ #include #include @@ -69,7 +66,7 @@ diff -ruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c int do_tumble = -1; /* -1 means not initialized */ int do_duplex = -1; gchar *paps_header = NULL; -@@ -323,12 +326,121 @@ +@@ -323,12 +326,123 @@ int header_sep = 20; int max_width = 0, w; GIConv cvh = NULL; @@ -181,7 +178,9 @@ diff -ruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c + // http://cups.org/newsgroups.php?s9797+gcups.general+v9797+T1 + if (!g_ascii_strcasecmp(charset, "windows-932")) + charset = "WINDOWS-31J"; -+ encoding = g_strdup(charset); ++ if (g_ascii_strcasecmp(charset, "utf-8") && ++ g_ascii_strcasecmp(charset, "utf8")) ++ encoding = g_strdup(charset); + } + } + } G_STMT_END; @@ -191,7 +190,7 @@ diff -ruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c /* Parse command line */ if (!g_option_context_parse(ctxt, &argc, &argv, &error)) { -@@ -355,6 +467,8 @@ +@@ -355,6 +469,8 @@ IN = stdin; } title = filename_in; @@ -200,7 +199,7 @@ diff -ruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c paps = paps_new(); pango_context = paps_get_pango_context (paps); -@@ -373,8 +487,10 @@ +@@ -373,8 +489,10 @@ pango_context_set_font_description (pango_context, font_description); /* Page layout */ @@ -213,7 +212,7 @@ diff -ruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c if (num_columns == 1) total_gutter_width = 0; -@@ -435,6 +551,8 @@ +@@ -435,6 +553,8 @@ page_layout.pango_dir = pango_dir; page_layout.filename = filename_in; page_layout.header_font_desc = header_font_desc; @@ -222,7 +221,7 @@ diff -ruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c /* calculate x-coordinate scale */ if (cpi > 0.0L) -@@ -571,6 +689,12 @@ +@@ -571,6 +691,12 @@ if (wc == (gunichar)-1) { fprintf (stderr, "%s: Invalid character in input\n", g_get_prgname ()); @@ -235,7 +234,7 @@ diff -ruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c wc = 0; } if (!*p || !wc || wc == '\n' || wc == '\f') -@@ -784,6 +908,7 @@ +@@ -784,6 +910,7 @@ int orientation = page_layout->page_width > page_layout->page_height; int bb_page_width = page_layout->page_width; int bb_page_height = page_layout->page_height; @@ -243,7 +242,7 @@ diff -ruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c /* Keep bounding box non-rotated to make ggv happy */ if (orientation) -@@ -793,12 +918,20 @@ +@@ -793,12 +920,20 @@ bb_page_height = tmp; } @@ -265,7 +264,7 @@ diff -ruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c "%%%%BeginProlog\n" "%%%%Orientation: %s\n" "/papsdict 1 dict def\n" -@@ -848,8 +981,10 @@ +@@ -848,8 +983,10 @@ title, bb_page_width, bb_page_height, diff --git a/paps.spec b/paps.spec index e985cac..3c1ae33 100644 --- a/paps.spec +++ b/paps.spec @@ -1,6 +1,6 @@ Name: paps Version: 0.6.6 -Release: 14%{?dist} +Release: 15%{?dist} License: LGPL URL: http://paps.sourceforge.net/ @@ -76,6 +76,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri Sep 29 2006 Tim Waugh - 0.6.6-15 +- Avoid using iconv when not needed (bug #206259). + * Thu Sep 14 2006 Akira TAGOH - 0.6.6-14 - paps-cups.patch: try to parse input even if any invalid character appears. (#206259)