libppd (2:0.10-7) debian-dir only changes

Summary

 debian/B.Link/empty_option.patch |   50 ++++++++++++++++
 debian/B.Link/memcpy.2.diff      |  111 ++++++++++++++++++++++++++++++++++++
 debian/B.Link/memcpy.patch       |  111 ++++++++++++++++++++++++++++++++++++
 debian/B.Link/nup.diff           |   14 ++++
 debian/changelog                 |  118 +++++++++++++++++++++++++++++++++++++++
 debian/compat                    |    2 
 debian/control                   |   38 ++++++++++++
 debian/copyright                 |   29 +++++++++
 debian/libppd-dev.files          |    5 +
 debian/libppd0.files             |    1 
 debian/libppd0.postinst          |    4 +
 debian/ppdfilt.files             |    2 
 debian/rules                     |   87 ++++++++++++++++++++++++++++
 debian/shlibs.local              |    1 
 14 files changed, 573 insertions(+)

    
download this patch

Patch contents

--- libppd-0.10.orig/debian/libppd-dev.files
+++ libppd-0.10/debian/libppd-dev.files
@@ -0,0 +1,5 @@
+usr/include/ppd*
+usr/lib/libppd.so
+usr/lib/libppd.la
+usr/lib/libppd.a
+usr/share/man/man3/
--- libppd-0.10.orig/debian/compat
+++ libppd-0.10/debian/compat
@@ -0,0 +1,2 @@
+4
+
--- libppd-0.10.orig/debian/rules
+++ libppd-0.10/debian/rules
@@ -0,0 +1,87 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# This file is public domain software, originally written by Joey Hess.
+#
+# This version is for a multibinary package. It also allows you to build any
+# of the binary packages independantly, via binary-<package> targets.
+
+# Uncomment this to turn on verbose mode. 
+#export DH_VERBOSE=1
+CFLAGS = -Wall -g
+INSTALL = install
+INSTALL_FILE    = $(INSTALL) -p    -o root -g root  -m  644
+INSTALL_PROGRAM = $(INSTALL) -p    -o root -g root  -m  755
+INSTALL_SCRIPT  = $(INSTALL) -p    -o root -g root  -m  755
+INSTALL_DIR     = $(INSTALL) -p -d -o root -g root  -m  755
+export CFLAGS INSTALL_FILE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DIR
+
+ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -O0
+else
+ CFLAGS += -O2
+endif
+ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
+ INSTALL_PROGRAM += -s
+endif
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ MAKEFLAGS += -j$(NUMJOBS)
+endif
+
+autogen:
+	libtoolize --force --copy
+	aclocal
+	automake -a
+	autoconf
+
+build: build-stamp
+build-stamp:
+	dh_testdir
+	# avoid time skews
+	touch configure.in && 	touch aclocal.m4 && 	touch configure
+	touch config.h.in  */Makefile.in  Makefile.in
+	./configure --prefix=/usr --with-glib=2	 --mandir=/usr/share/man 
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp config.log
+	[ ! -f Makefile ] || $(MAKE) distclean distclean-generic
+	dh_clean
+	#find config.sub config.guess ltmain.sh COPYING INSTALL intl -type l | xargs -r rm
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+	$(MAKE) DESTDIR=`pwd`/debian/tmp install
+	dh_movefiles
+
+
+# Nothing to do.
+binary-indep:
+
+# Build architecture dependant packages using the common target.
+binary-arch: install
+	#dh_testversion 2
+	dh_testdir
+	dh_testroot
+	dh_installdocs AUTHORS # NEWS README
+	dh_installexamples
+	dh_installchangelogs # ChangeLog
+	dh_compress
+	dh_strip
+	dh_fixperms
+	# Keep -V on until the library reaches major version 1.
+	dh_makeshlibs -V
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+
+.PHONY: build clean binary-indep binary-arch binary install
--- libppd-0.10.orig/debian/libppd0.postinst
+++ libppd-0.10/debian/libppd0.postinst
@@ -0,0 +1,4 @@
+#!/bin/sh -e
+
+#DEBHELPER#
+
--- libppd-0.10.orig/debian/libppd0.files
+++ libppd-0.10/debian/libppd0.files
@@ -0,0 +1 @@
+usr/lib/libppd.so.*
--- libppd-0.10.orig/debian/copyright
+++ libppd-0.10/debian/copyright
@@ -0,0 +1,29 @@
+This is a Debian prepackaged version of libppd.
+
+This package was put together by Joey Hess <joeyh@debian.org>, using
+sources from:
+	http://download.sourceforge.net/libppd/
+or  http://sourceforge.net/project/showfiles.php?group_id=3800&package_id=11729
+
+Copyright 1993-1999 by Easy Software Products.
+
+Authors:
+ Ben Woodard <ben@valinux.com>
+ Mark Fasheh <mfasheh@valinux.com>
+
+
+License :  GNU GENERAL PUBLIC LICENSE ,  Version 2, June 1991
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+On Debian systems, the complete text of the GNU Library
+General Public License can be found in /usr/share/common-licenses/GPL
+
--- libppd-0.10.orig/debian/control
+++ libppd-0.10/debian/control
@@ -0,0 +1,38 @@
+Source: libppd
+Section: libs
+Priority: optional
+Maintainer: A Mennucc1 <mennucc1@debian.org>
+Build-Depends: debhelper (>= 2), libtool, libglib2.0-dev
+Standards-Version: 3.8.0.0
+
+Package: libppd-dev
+Section: libdevel
+Architecture: any
+Depends: libppd0 (= ${binary:Version}), libc6-dev
+Description: postscript PPD file library, development kit
+ This package contains the static library and header files used in
+ development of programs that use libppd.
+
+Package: ppdfilt
+Section: utils
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: filter that inserts printer specific commands into print jobs
+ ppdfilt is a filter program designed to be used within a filter
+ script or from the command line tool to insert printer specific
+ commands to a PostScript print job. This can be used to tell the printer
+ to duplex or staple the print job, or tell it what paper tray to draw
+ paper from. In the GNULpr printing environment, users do not call ppdfilt
+ directly, but its features are accessed by using 'lpr' or 'gpr' (see)
+
+Package: libppd0
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: postscript PPD file library
+ PostScript was designed as a device independent language. To be able
+ to access device specific features like selecting different paper
+ trays and turning on different imaging models, each printer vendor
+ supplies a PostScript Printer Definition or PPD file. This library
+ reads those PPD files and provides functions that allow a program to
+ modify PostScript print jobs to acces these special features.
+
--- libppd-0.10.orig/debian/shlibs.local
+++ libppd-0.10/debian/shlibs.local
@@ -0,0 +1 @@
+libppd 0 libppd0 (>= 0.3)
--- libppd-0.10.orig/debian/ppdfilt.files
+++ libppd-0.10/debian/ppdfilt.files
@@ -0,0 +1,2 @@
+usr/share/man/man1/ppdfilt.1
+usr/bin/ppdfilt
--- libppd-0.10.orig/debian/changelog
+++ libppd-0.10/debian/changelog
@@ -0,0 +1,118 @@
+libppd (2:0.10-7) unstable; urgency=low
+
+  * fix for "ppdfilt -Z number-up:4",
+    patch by Bernhard R. Link (Closes: #423387).
+  * refresh all auto* stuff
+  * up standard up! to 3.8.0
+  * shut up lintian warnings
+      debian-rules-sets-DH_COMPAT
+      debian-rules-ignores-make-clean-error 
+      substvar-source-version-is-deprecated 
+      dev-package-should-be-section-libdevel libppd-dev
+
+ -- A Mennucc1 <mennucc1@debian.org>  Thu, 25 Sep 2008 20:09:43 +0200
+
+libppd (2:0.10-6) unstable; urgency=low
+
+  * ppdfilt: use memcpy, since source and destination overlap in strcpy, thanks
+    to Bernhard R. Link (Closes: #422826).
+  * avoid double ldconfig
+
+ -- A Mennucc1 <mennucc1@debian.org>  Fri, 18 May 2007 19:33:57 +0200
+
+libppd (2:0.10-5) unstable; urgency=low
+  
+  * use glib2.0
+  * ppdfilt: orientation was random when not explicitly given, thanks
+    to Bernhard R. Link (Closes: #422821).
+  * fixed FTBFS: bashisms in debian/rules, thanks to Julien
+    Danjou (Closes: #372744).
+  * ppdfilt: supports empty and comma separated options
+    to -Z, thanks to Bernhard R. Link (Closes: #422823).
+  * and also deletes leading and trailing spaces in options.
+  * rewritten ppdfilt manpage (no more pstops gibberish)
+  * better debian/copyright
+
+ -- A Mennucc1 <mennucc1@debian.org>  Thu, 17 May 2007 13:54:17 +0200
+
+libppd (2:0.10-4) unstable; urgency=low
+
+  * do not change include_HEADERS to srcinclude_HEADERS in src/Makefile.am
+
+ -- A Mennucc1 <mennucc1@debian.org>  Sun, 20 Mar 2005 11:13:12 +0100
+
+libppd (2:0.10-3) unstable; urgency=medium
+
+  * wrong configure : this version should be compiled with glib 1
+   (there is no point in using glib2, as long as 'gpr' uses gtk1.2 )
+  (Closes: #300161)
+
+ -- A Mennucc1 <mennucc1@debian.org>  Fri, 18 Mar 2005 09:52:03 +0100
+
+libppd (2:0.10-2) unstable; urgency=low
+  
+  * supports both glib 1 or 2
+
+ -- A Mennucc1 <mennucc1@debian.org>  Fri, 17 Mar 2005 15:45:00 +0100
+
+libppd (2:0.10-1) unstable; urgency=low
+  
+  * new upstream : fixes problem with  Duplex options, and closes
+   "Upstream URL dead, new upstream version at different
+    location", thanks to Jeroen van Wolffelaar (Closes: #274285).
+  * add   libppd-dev (= ${Source-Version}) to dependency
+  * libtoolize --force --copy  , with handmade tweaks
+  * do not build-depend and do not call  automake , autoconf
+  * Bug fix: "libppd0: Spelling error in description", thanks to Matt
+    Zimmerman (Closes: #125017).
+
+ -- A Mennucc1 <mennucc1@debian.org>  Thu, 17 Mar 2005 14:22:20 +0100
+
+libppd (2:0.9-1) unstable; urgency=low
+
+  * new upstream
+
+ -- A Mennucc1 <debian@Tonelli.sns.it>  Mon, 29 Oct 2001 18:46:01 +0100
+
+libppd (2:0.4-2) unstable; urgency=low
+
+  * libtoolize --force --copy (closes: #105638)
+
+ -- A Mennucc1 <debian@Tonelli.sns.it>  Wed, 18 Jul 2001 15:35:15 +0200
+
+libppd (2:0.4-1) unstable; urgency=low
+
+  * better description
+  * -dev section is devel
+  * used new libtool and automake (closes: #104655, #105230)
+  * build-depends  on libtool (closes: #104551)
+  * I did a mess with the version: this is libppd 0.4 upstream
+
+ -- A Mennucc1 <debian@Tonelli.sns.it>  Mon, 16 Jul 2001 11:43:06 +0200
+
+libppd (1:0.5) unstable; urgency=low
+
+  * New Mantainer
+
+ -- A Mennucc1 <debian@tonelli.sns.it>  Fri, 29 Jun 2001 16:46:06 +0200
+
+libppd (1:0.4) unstable; urgency=low
+
+  * cleaned up and added -1 tag for multiple hideous debian package builds.
+
+ -- Nick Moffitt <nick@valinux.com>  Thu, 15 Feb 2001 11:35:49 -0800
+
+libppd (0.4) unstable; urgency=low
+
+  * Updated to 0.4.
+
+ -- Joey Hess <joeyh@debian.org>  Thu,  6 Jul 2000 11:35:49 -0700
+
+libppd (0.3) unstable; urgency=low
+
+  * Initial debianization. Debian native since the debian directory is in
+    cvs.
+
+ -- Joey Hess <joeyh@debian.org>  Mon, 17 Apr 2000 13:48:59 -0700
+
+
--- libppd-0.10.orig/debian/B.Link/nup.diff
+++ libppd-0.10/debian/B.Link/nup.diff
@@ -0,0 +1,14 @@
+diff -u -r libppd-0.10.OLD/src/ppdfilt.c libppd-0.10/src/ppdfilt.c
+--- libppd-0.10.OLD/src/ppdfilt.c	2008-08-18 14:25:51.000000000 +0000
++++ libppd-0.10/src/ppdfilt.c	2008-08-18 14:34:25.000000000 +0000
+@@ -554,7 +554,9 @@
+ 
+   if (NUp > 1)
+     puts("userdict begin\n" "/ESPshowpage /showpage load def\n"
+-	 "/showpage { } def\n" "end");
++	 "/showpage { } def\n"
++	 "/setpagedevice {pop}bind 1 index where{dup wcheck{3 1 roll put}{pop def}ifelse}{def}ifelse\n"
++	 "end");
+ 
+   if (gamma != 1.0 || brightness != 1.0)
+     printf("{ neg 1 add dup 0 lt { pop 1 } { %.3f exp neg 1 add } "
--- libppd-0.10.orig/debian/B.Link/memcpy.2.diff
+++ libppd-0.10/debian/B.Link/memcpy.2.diff
@@ -0,0 +1,111 @@
+diff -r -u -p libppd-0.10.original/src/ppd.c libppd-0.10/src/ppd.c
+--- libppd-0.10.original/src/ppd.c	2001-07-19 20:23:02.000000000 +0200
++++ libppd-0.10/src/ppd.c	2007-05-09 10:01:51.000000000 +0200
+@@ -740,7 +740,7 @@ PpdFile *ppd_file_new_from_filep(FILE * 
+     } else if (strcmp(keyword, "OpenUI") == 0) {
+       /* Add an option record to the current sub-group, group, or file... */
+       if (name[0] == '*')
+-	strcpy(name, name + 1);
++	memmove(name, name + 1, strlen(name));
+ 
+       if (string == NULL)
+ 	goto failout1;
+@@ -807,7 +807,7 @@ PpdFile *ppd_file_new_from_filep(FILE * 
+ 
+       // Add an option record to the current JCLs...
+       if (name[0] == '*')
+-	strcpy(name, name + 1);
++	memmove(name, name + 1, strlen(name));
+ 
+       if ((option = ppd_get_option(group, name)) == NULL)
+ 	option = ppd_option_new(group, keyword);
+@@ -828,11 +828,12 @@ PpdFile *ppd_file_new_from_filep(FILE * 
+ 	       || strcmp(keyword, "JCLCloseUI") == 0)
+       option = NULL;
+     else if (strcmp(keyword, "OpenGroup") == 0) {
++      char *h;
+       // Open a new group...
+       if (group != NULL)
+ 	goto failout;
+-      if (strchr(string, '/') != NULL)	// Just show human readable text 
+-	strcpy(string, strchr(string, '/') + 1);
++      if ((h = strchr(string, '/')) != NULL)	// Just show human readable text
++	memmove(string, h + 1, strlen(h));
+ 
+       ppd_decode(string);
+       ppd_fix(string);
+@@ -858,7 +859,7 @@ PpdFile *ppd_file_new_from_filep(FILE * 
+       if (sscanf(string, "%f%40s%40s", &order, name, keyword) != 3)
+ 	goto failout;
+       if (keyword[0] == '*')
+-	strcpy(keyword, keyword + 1);
++	memmove(keyword, keyword + 1, strlen(keyword));
+ 
+       if (strcmp(name, "ExitServer") == 0)
+ 	section = PPD_ORDER_EXIT;
+@@ -1003,46 +1004,44 @@ PpdFile *ppd_file_new_from_filep(FILE * 
+ 	break;
+       case 2:			// Two options... 
+ 	if (copt1[0] == '*')
+-	  strcpy(copt1, copt1 + 1);
++	  constraint->option1 = g_string_new(copt1 + 1);
++	else
++	  constraint->option1 = g_string_new(copt1);
+ 
+ 	if (cchoice1[0] == '*')
+-	  strcpy(copt2, cchoice1 + 1);
++	  constraint->option2 = g_string_new(cchoice1 + 1);
+ 	else
+-	  strcpy(copt2, cchoice1);
++	  constraint->option2 = g_string_new(cchoice1);
+ 
+-	constraint->option1 = g_string_new(copt1);
+-	constraint->option2 = g_string_new(copt2);
+ 	break;
+       case 3:			// Two options, one choice... 
+ 	if (copt1[0] == '*')
+-	  strcpy(copt1, copt1 + 1);
+-	constraint->option1 = g_string_new(copt1);
++	  constraint->option1 = g_string_new(copt1 + 1);
++	else
++	  constraint->option1 = g_string_new(copt1);
+ 
+ 	if (cchoice1[0] == '*') {
+-	  strcpy(cchoice2, copt2);
+-	  strcpy(copt2, cchoice1 + 1);
+-	  cchoice1[0] = '\0';
+-
+-	  constraint->choice2 = g_string_new(cchoice2);
+-	  constraint->option2 = g_string_new(copt2);
++	  constraint->choice2 = g_string_new(copt2);
++	  constraint->option2 = g_string_new(cchoice1 + 1);
+ 	} else {
+ 	  if (copt2[0] == '*')
+-	    strcpy(copt2, copt2 + 1);
+-
+-	  constraint->option2 = g_string_new(copt2);
+-	  cchoice2[0] = '\0';
++	    constraint->option2 = g_string_new(copt2 + 1);
++	  else
++	    constraint->option2 = g_string_new(copt2);
+ 	}
+ 
+ 	break;
+       case 4:			// Two options, two choices... 
+ 	if (copt1[0] == '*')
+-	  strcpy(copt1, copt1 + 1);
++	  constraint->option1 = g_string_new(copt1 + 1);
++	else
++	  constraint->option1 = g_string_new(copt1);
+ 
+ 	if (copt2[0] == '*')
+-	  strcpy(copt2, copt2 + 1);
++	  constraint->option2 = g_string_new(copt2 + 1);
++	else
++	  constraint->option2 = g_string_new(copt2);
+ 
+-	constraint->option1 = g_string_new(copt1);
+-	constraint->option2 = g_string_new(copt2);
+ 	constraint->choice1 = g_string_new(cchoice1);
+ 	constraint->choice2 = g_string_new(cchoice2);
+ 	break;
--- libppd-0.10.orig/debian/B.Link/memcpy.patch
+++ libppd-0.10/debian/B.Link/memcpy.patch
@@ -0,0 +1,111 @@
+diff -r -u -p libppd-0.10.original/src/ppd.c libppd-0.10/src/ppd.c
+--- libppd-0.10.original/src/ppd.c	2001-07-19 20:23:02.000000000 +0200
++++ libppd-0.10/src/ppd.c	2007-05-08 12:35:50.000000000 +0200
+@@ -740,7 +740,7 @@ PpdFile *ppd_file_new_from_filep(FILE * 
+     } else if (strcmp(keyword, "OpenUI") == 0) {
+       /* Add an option record to the current sub-group, group, or file... */
+       if (name[0] == '*')
+-	strcpy(name, name + 1);
++	memmove(name, name + 1, strlen(name));
+ 
+       if (string == NULL)
+ 	goto failout1;
+@@ -807,7 +807,7 @@ PpdFile *ppd_file_new_from_filep(FILE * 
+ 
+       // Add an option record to the current JCLs...
+       if (name[0] == '*')
+-	strcpy(name, name + 1);
++	memmove(name, name + 1, strlen(name));
+ 
+       if ((option = ppd_get_option(group, name)) == NULL)
+ 	option = ppd_option_new(group, keyword);
+@@ -828,11 +828,12 @@ PpdFile *ppd_file_new_from_filep(FILE * 
+ 	       || strcmp(keyword, "JCLCloseUI") == 0)
+       option = NULL;
+     else if (strcmp(keyword, "OpenGroup") == 0) {
++      char *h;
+       // Open a new group...
+       if (group != NULL)
+ 	goto failout;
+-      if (strchr(string, '/') != NULL)	// Just show human readable text 
+-	strcpy(string, strchr(string, '/') + 1);
++      if ((h = strchr(string, '/')) != NULL)	// Just show human readable text
++	memmove(string, h, strlen(h)+1);
+ 
+       ppd_decode(string);
+       ppd_fix(string);
+@@ -858,7 +859,7 @@ PpdFile *ppd_file_new_from_filep(FILE * 
+       if (sscanf(string, "%f%40s%40s", &order, name, keyword) != 3)
+ 	goto failout;
+       if (keyword[0] == '*')
+-	strcpy(keyword, keyword + 1);
++	memmove(keyword, keyword + 1, strlen(keyword));
+ 
+       if (strcmp(name, "ExitServer") == 0)
+ 	section = PPD_ORDER_EXIT;
+@@ -1003,46 +1004,44 @@ PpdFile *ppd_file_new_from_filep(FILE * 
+ 	break;
+       case 2:			// Two options... 
+ 	if (copt1[0] == '*')
+-	  strcpy(copt1, copt1 + 1);
++	  constraint->option1 = g_string_new(copt1 + 1);
++	else
++	  constraint->option1 = g_string_new(copt1);
+ 
+ 	if (cchoice1[0] == '*')
+-	  strcpy(copt2, cchoice1 + 1);
++	  constraint->option2 = g_string_new(cchoice1 + 1);
+ 	else
+-	  strcpy(copt2, cchoice1);
++	  constraint->option2 = g_string_new(cchoice1);
+ 
+-	constraint->option1 = g_string_new(copt1);
+-	constraint->option2 = g_string_new(copt2);
+ 	break;
+       case 3:			// Two options, one choice... 
+ 	if (copt1[0] == '*')
+-	  strcpy(copt1, copt1 + 1);
+-	constraint->option1 = g_string_new(copt1);
++	  constraint->option1 = g_string_new(copt1 + 1);
++	else
++	  constraint->option1 = g_string_new(copt1);
+ 
+ 	if (cchoice1[0] == '*') {
+-	  strcpy(cchoice2, copt2);
+-	  strcpy(copt2, cchoice1 + 1);
+-	  cchoice1[0] = '\0';
+-
+-	  constraint->choice2 = g_string_new(cchoice2);
+-	  constraint->option2 = g_string_new(copt2);
++	  constraint->choice2 = g_string_new(copt2);
++	  constraint->option2 = g_string_new(cchoice1 + 1);
+ 	} else {
+ 	  if (copt2[0] == '*')
+-	    strcpy(copt2, copt2 + 1);
+-
+-	  constraint->option2 = g_string_new(copt2);
+-	  cchoice2[0] = '\0';
++	    constraint->option2 = g_string_new(copt2 + 1);
++	  else
++	    constraint->option2 = g_string_new(copt2);
+ 	}
+ 
+ 	break;
+       case 4:			// Two options, two choices... 
+ 	if (copt1[0] == '*')
+-	  strcpy(copt1, copt1 + 1);
++	  constraint->option1 = g_string_new(copt1 + 1);
++	else
++	  constraint->option1 = g_string_new(copt1);
+ 
+ 	if (copt2[0] == '*')
+-	  strcpy(copt2, copt2 + 1);
++	  constraint->option2 = g_string_new(copt2 + 1);
++	else
++	  constraint->option2 = g_string_new(copt2);
+ 
+-	constraint->option1 = g_string_new(copt1);
+-	constraint->option2 = g_string_new(copt2);
+ 	constraint->choice1 = g_string_new(cchoice1);
+ 	constraint->choice2 = g_string_new(cchoice2);
+ 	break;
--- libppd-0.10.orig/debian/B.Link/empty_option.patch
+++ libppd-0.10/debian/B.Link/empty_option.patch
@@ -0,0 +1,50 @@
+diff -r -u -p libppd-0.10.original/src/ppdfilt.c libppd-0.10/src/ppdfilt.c
+--- libppd-0.10.original/src/ppdfilt.c	2001-11-05 22:22:42.000000000 +0100
++++ libppd-0.10/src/ppdfilt.c	2007-05-08 11:39:09.000000000 +0200
+@@ -341,7 +341,7 @@ int main(int argc, char *argv[])
+       {"help", no_argument, NULL, '?'},
+       {0, 0, 0, 0}
+     };
+-    char *cur;
++    char *cur, *next;
+     copies = 1;
+     num_options = 0;
+     options = NULL;
+@@ -358,16 +358,27 @@ int main(int argc, char *argv[])
+ 	break;
+       case 'o':
+       case 'Z':
+-	if ((cur = strchr(optarg, ':')) == NULL) {
+-	  fprintf(stderr, "Bad option format: %s\n", optarg);
+-	  exit(2);
+-	}
+-	*cur = 0;		// break the string
+-	cur++;			// point cur to the value
+-	/* MLP: skip past leading spaces. */
+-	while (cur && (cur[0] == ' '))
+-	  cur++;
+-	num_options = cupsAddOption(optarg, cur, num_options, &options);
++	/* Ignore empty argument (to ease usage in magicfilter rules) */
++	if (optarg[0] == '\0')
++		break;
++	do {
++	  if ((cur = strchr(optarg, ':')) == NULL) {
++	    fprintf(stderr, "Bad option format: %s\n", optarg);
++	    exit(2);
++	  }
++	  *cur = 0;		// break the string
++	  cur++;		// point cur to the value
++	  /* MLP: skip past leading spaces. */
++	  while (cur && (cur[0] == ' '))
++	    cur++;
++	  /* allow comma seperated values to ease usage from LPRng */
++	  if ((next = strchr(cur, ',')) != NULL) {
++	    *next = 0;		// break the string
++	    next++;
++	  }
++	  num_options = cupsAddOption(optarg, cur, num_options, &options);
++	  optarg = next;
++	} while (next != NULL);
+ 	break;
+       case 'p':
+ 	ppdfilename = optarg;