- paps-cups.patch: try to parse input even if any invalid character

appears. (#206259)
This commit is contained in:
Akira TAGOH 2006-09-14 08:15:57 +00:00
parent 0a9085167d
commit 1e01c99d83
2 changed files with 65 additions and 40 deletions

View File

@ -1,5 +1,27 @@
--- paps-0.6.6/src/Makefile.am.cups 2006-08-17 12:12:43.000000000 +0100
+++ paps-0.6.6/src/Makefile.am 2006-08-17 12:12:43.000000000 +0100
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 @@
AC_PROG_CC
AM_PROG_LIBTOOL
+dnl ======================================================
+dnl check for CUPS
+dnl ======================================================
+AC_PATH_PROG(CUPS_CONFIG, cups-config, no)
+if test "$CUPS_CONFIG" = "no"; then
+ AC_MSG_ERROR([Please install cups development packages])
+fi
+CUPS_CFLAGS=`$CUPS_CONFIG --cflags | sed 's/-O[0-9]*//' | sed 's/-m[^\t]*//g'`
+CUPS_LIBS=`$CUPS_CONFIG --libs`
+
+AC_SUBST(CUPS_CFLAGS)
+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 @@
libpaps_a_incdir = $(includedir)
@ -13,8 +35,9 @@
paps_DEPENDENCIES = $(noinst_LIBRARIES)
EXTRA_DIST = test_libpaps.c paps.1
--- paps-0.6.6/src/paps.c.cups 2006-08-17 12:12:43.000000000 +0100
+++ paps-0.6.6/src/paps.c 2006-08-17 12:35:56.000000000 +0100
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
@@ -31,6 +31,7 @@
#include <time.h>
#include <locale.h>
@ -23,7 +46,11 @@
#define BUFSIZE 1024
#define DEFAULT_FONT_FAMILY "Monospace"
@@ -87,6 +88,7 @@
@@ -84,9 +85,11 @@
gboolean do_separation_line;
gboolean do_draw_contour;
gboolean do_wordwrap;
+ gboolean cups_mode;
PangoDirection pango_dir;
gchar *filename;
gchar *header_font_desc;
@ -31,7 +58,7 @@
} page_layout_t;
typedef struct {
@@ -313,8 +315,8 @@
@@ -313,8 +316,8 @@
int num_pages = 1;
int gutter_width = 40;
int total_gutter_width;
@ -42,7 +69,7 @@
int do_tumble = -1; /* -1 means not initialized */
int do_duplex = -1;
gchar *paps_header = NULL;
@@ -323,12 +325,121 @@
@@ -323,12 +326,121 @@
int header_sep = 20;
int max_width = 0, w;
GIConv cvh = NULL;
@ -164,7 +191,7 @@
/* Parse command line */
if (!g_option_context_parse(ctxt, &argc, &argv, &error))
{
@@ -355,6 +466,8 @@
@@ -355,6 +467,8 @@
IN = stdin;
}
title = filename_in;
@ -173,7 +200,7 @@
paps = paps_new();
pango_context = paps_get_pango_context (paps);
@@ -373,8 +486,10 @@
@@ -373,8 +487,10 @@
pango_context_set_font_description (pango_context, font_description);
/* Page layout */
@ -186,15 +213,29 @@
if (num_columns == 1)
total_gutter_width = 0;
@@ -435,6 +550,7 @@
@@ -435,6 +551,8 @@
page_layout.pango_dir = pango_dir;
page_layout.filename = filename_in;
page_layout.header_font_desc = header_font_desc;
+ page_layout.owner = page_owner;
+ page_layout.cups_mode = cups_mode;
/* calculate x-coordinate scale */
if (cpi > 0.0L)
@@ -781,6 +897,7 @@
@@ -571,6 +689,12 @@
if (wc == (gunichar)-1)
{
fprintf (stderr, "%s: Invalid character in input\n", g_get_prgname ());
+ if (page_layout->cups_mode)
+ {
+ /* try to continue parsing texts */
+ p = next;
+ continue;
+ }
wc = 0;
}
if (!*p || !wc || wc == '\n' || wc == '\f')
@@ -784,6 +908,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;
@ -202,7 +243,7 @@
/* Keep bounding box non-rotated to make ggv happy */
if (orientation)
@@ -790,12 +907,20 @@
@@ -793,12 +918,20 @@
bb_page_height = tmp;
}
@ -224,7 +265,7 @@
"%%%%BeginProlog\n"
"%%%%Orientation: %s\n"
"/papsdict 1 dict def\n"
@@ -845,8 +970,10 @@
@@ -848,8 +981,10 @@
title,
bb_page_width,
bb_page_height,
@ -235,23 +276,3 @@
fprintf(OUT,
"%% User settings\n"
--- paps-0.6.6/configure.in.cups 2006-04-27 20:41:36.000000000 +0100
+++ paps-0.6.6/configure.in 2006-08-17 12:12:43.000000000 +0100
@@ -7,4 +7,17 @@
AC_PROG_CC
AM_PROG_LIBTOOL
+dnl ======================================================
+dnl check for CUPS
+dnl ======================================================
+AC_PATH_PROG(CUPS_CONFIG, cups-config, no)
+if test "$CUPS_CONFIG" = "no"; then
+ AC_MSG_ERROR([Please install cups development packages])
+fi
+CUPS_CFLAGS=`$CUPS_CONFIG --cflags | sed 's/-O[0-9]*//' | sed 's/-m[^\t]*//g'`
+CUPS_LIBS=`$CUPS_CONFIG --libs`
+
+AC_SUBST(CUPS_CFLAGS)
+AC_SUBST(CUPS_LIBS)
+
AC_OUTPUT(Makefile src/Makefile doc/Makefile)

View File

@ -1,6 +1,6 @@
Name: paps
Version: 0.6.6
Release: 13%{?dist}
Release: 14%{?dist}
License: LGPL
URL: http://paps.sourceforge.net/
@ -8,21 +8,21 @@ Source0: http://prdownloads.sourceforge.net/paps/paps-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: pango-devel automake autoconf libtool doxygen cups-devel
Patch0: paps-makefile.patch
## http://sourceforge.net/mailarchive/forum.php?thread_id=9329194&forum_id=47278
## fixed in CVS
Patch2: paps-formfeed.patch
## http://sourceforge.net/tracker/index.php?func=detail&aid=1494769&group_id=153049&atid=786242
## fixed in CVS
Patch3: paps-0.6.6-encoding.patch
## fixed in CVS
Patch4: paps-typo-font-scale.patch
## fixed in CVS
Patch5: paps-0.6.6-segfault.patch
## http://sourceforge.net/tracker/index.php?func=detail&aid=1512382&group_id=153049&atid=786242
## fixed in CVS
Patch6: paps-0.6.6-font-option.patch
## http://sourceforge.net/tracker/index.php?func=detail&aid=1512384&group_id=153049&atid=786239
## fixed in CVS
Patch7: paps-0.6.6-lcctype.patch
## http://sourceforge.net/tracker/index.php?func=detail&aid=1512385&group_id=153049&atid=786239
## fixed in CVS
Patch8: paps-0.6.6-wordwrap.patch
## http://sourceforge.net/tracker/index.php?func=detail&aid=1472021&group_id=153049&atid=786242
## fixed in CVS
Patch9: paps-0.6.6-cpilpi.patch
Patch50: paps-cups.patch
@ -76,6 +76,10 @@ rm -rf $RPM_BUILD_ROOT
%changelog
* Thu Sep 14 2006 Akira TAGOH <tagoh@redhat.com> - 0.6.6-14
- paps-cups.patch: try to parse input even if any invalid character appears.
(#206259)
* Thu Aug 31 2006 Akira TAGOH <tagoh@redhat.com> - 0.6.6-13
- paps-formfeed.patch: fixed to not insert an extra line in next page.
(#202731)