From 017964acd5e99a6a6daeac09e2fec17f29bcf74d Mon Sep 17 00:00:00 2001 From: ajacoutot Date: Thu, 11 Nov 2010 12:55:24 +0000 Subject: [PATCH] Add a couple of upstream patches from Abel Abraham Camarillo Ojeda to fix some lpr usages. --- print/foomatic-filters/Makefile | 4 ++- .../patches/patch-fileconverter_c | 18 +++++++++++ print/foomatic-filters/patches/patch-util_c | 32 ++++++++++++++++--- 3 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 print/foomatic-filters/patches/patch-fileconverter_c diff --git a/print/foomatic-filters/Makefile b/print/foomatic-filters/Makefile index 4f1dd94a9da..d743c249b68 100644 --- a/print/foomatic-filters/Makefile +++ b/print/foomatic-filters/Makefile @@ -1,10 +1,12 @@ -# $OpenBSD: Makefile,v 1.21 2010/10/18 21:25:08 espie Exp $ +# $OpenBSD: Makefile,v 1.22 2010/11/11 12:55:24 ajacoutot Exp $ COMMENT= Foomatic PPD print filters DISTNAME= foomatic-filters-4.0.5 CATEGORIES= print +REVISION= 0 + HOMEPAGE= http://www.linuxfoundation.org/en/OpenPrinting/Database/Foomatic MAINTAINER= Antoine Jacoutot diff --git a/print/foomatic-filters/patches/patch-fileconverter_c b/print/foomatic-filters/patches/patch-fileconverter_c new file mode 100644 index 00000000000..b701c19bd56 --- /dev/null +++ b/print/foomatic-filters/patches/patch-fileconverter_c @@ -0,0 +1,18 @@ +$OpenBSD: patch-fileconverter_c,v 1.1 2010/11/11 12:55:24 ajacoutot Exp $ + +Upstream r241. + +--- fileconverter.c.orig Thu Nov 11 13:47:02 2010 ++++ fileconverter.c Thu Nov 11 13:46:20 2010 +@@ -49,8 +49,10 @@ void set_fileconverter(const char *fc) + { + int i; + for (i = 0; fileconverters[i][0]; i++) { +- if (!strcmp(fc, fileconverters[i][0])) ++ if (!strcmp(fc, fileconverters[i][0])) { + strlcpy(fileconverter, fileconverters[i][1], PATH_MAX); ++ break; ++ } + } + if (!fileconverters[i][0]) + strlcpy(fileconverter, fc, PATH_MAX); diff --git a/print/foomatic-filters/patches/patch-util_c b/print/foomatic-filters/patches/patch-util_c index 573fb9e55c7..05766a43d24 100644 --- a/print/foomatic-filters/patches/patch-util_c +++ b/print/foomatic-filters/patches/patch-util_c @@ -1,7 +1,31 @@ -$OpenBSD: patch-util_c,v 1.2 2010/08/22 06:56:25 ajacoutot Exp $ +$OpenBSD: patch-util_c,v 1.3 2010/11/11 12:55:24 ajacoutot Exp $ + +Upstream r240. + --- util.c.orig Tue Aug 10 12:08:04 2010 -+++ util.c Sun Aug 22 07:15:52 2010 -@@ -162,6 +162,7 @@ strcasestr (const char *haystack, const char *needle) ++++ util.c Thu Nov 11 13:46:24 2010 +@@ -39,14 +39,15 @@ const char * temp_dir() + + if (!tmpdir) + { +- const char *dirs[] = { getenv("TMPDIR"), P_tmpdir, "/tmp", NULL }; +- const char **dir; ++ const char *dirs[] = { getenv("TMPDIR"), P_tmpdir, "/tmp" }; ++ int i; + +- for (dir = dirs; *dir; dir++) +- if (access(*dir, W_OK) == 0) { +- tmpdir = *dir; ++ for (i = 0; i < (sizeof(dirs) / sizeof(dirs[0])); i++) { ++ if (access(dirs[i], W_OK) == 0) { ++ tmpdir = dirs[i]; + break; + } ++ } + if (tmpdir) + { + _log("Storing temporary files in %s\n", tmpdir); +@@ -162,6 +163,7 @@ strcasestr (const char *haystack, const char *needle) } #endif @@ -9,7 +33,7 @@ $OpenBSD: patch-util_c,v 1.2 2010/08/22 06:56:25 ajacoutot Exp $ size_t strlcpy(char *dest, const char *src, size_t size) { char *pdest = dest; -@@ -201,6 +202,7 @@ size_t strlcat(char *dest, const char *src, size_t siz +@@ -201,6 +203,7 @@ size_t strlcat(char *dest, const char *src, size_t siz return len + (psrc - src); }