summaryrefslogtreecommitdiff
path: root/graphics/sane-backends
diff options
context:
space:
mode:
authormjl <mjl@pkgsrc.org>2002-02-16 15:10:57 +0000
committermjl <mjl@pkgsrc.org>2002-02-16 15:10:57 +0000
commitccb6f90d68b97909a1c9d1e1c93fb86548341630 (patch)
treebc34bbf45ce171a61f94f3fae075855e610ac3b7 /graphics/sane-backends
parent3fc5e98bc89997d354394f17077bc27ebafd6540 (diff)
downloadpkgsrc-ccb6f90d68b97909a1c9d1e1c93fb86548341630.tar.gz
Add a workaround for the horrifying construct
char **argvec = malloc(); vprintf(fmt, argvec); va_end(argvec); which of cource won't work on anything that does not pass its arguments on the stack (like PPC). This patch adds a handcrafted vprintf() lookalike damn_i386_centric_printf() that does TRT.
Diffstat (limited to 'graphics/sane-backends')
-rw-r--r--graphics/sane-backends/distinfo3
-rw-r--r--graphics/sane-backends/patches/patch-ae61
2 files changed, 63 insertions, 1 deletions
diff --git a/graphics/sane-backends/distinfo b/graphics/sane-backends/distinfo
index 2ee308c5bce..b092d44c2a1 100644
--- a/graphics/sane-backends/distinfo
+++ b/graphics/sane-backends/distinfo
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.6 2002/02/10 00:50:42 rh Exp $
+$NetBSD: distinfo,v 1.7 2002/02/16 15:10:57 mjl Exp $
SHA1 (sane-backends-1.0.7.tar.gz) = 5e527b62d067b50965155d9e0836c207139307e5
Size (sane-backends-1.0.7.tar.gz) = 1867577 bytes
SHA1 (patch-aa) = c17cbd11a05dcf62d0c2183859eeeac259a0026a
+SHA1 (patch-ae) = b7a98c7bccc36aa4db2f5788859298830a4e4f56
diff --git a/graphics/sane-backends/patches/patch-ae b/graphics/sane-backends/patches/patch-ae
new file mode 100644
index 00000000000..7855ff6558b
--- /dev/null
+++ b/graphics/sane-backends/patches/patch-ae
@@ -0,0 +1,61 @@
+$NetBSD: patch-ae,v 1.1 2002/02/16 15:10:57 mjl Exp $
+
+--- frontend/scanimage.c.orig Sat Feb 16 12:54:39 2002
++++ frontend/scanimage.c Sat Feb 16 13:06:23 2002
+@@ -64,6 +64,9 @@
+ }
+ Image;
+
++
++void damn_i386_centric_vprintf(const char *, const char **);
++
+ #define OPTION_FORMAT 1001
+ #define OPTION_MD5 1002
+ #define OPTION_BATCH_COUNT 1003
+@@ -1561,8 +1564,8 @@
+ }
+ start = percent;
+ }
+- vprintf(fmt, (va_list) arglist);
+- va_end(arglist);
++ damn_i386_centric_vprintf(fmt, arglist);
++ free(arglist);
+ }
+ }
+
+@@ -1910,3 +1913,35 @@
+
+ return status;
+ }
++
++void damn_i386_centric_vprintf(const char *fmt, const char **arglist)
++ {
++ int c;
++
++ while(c = *fmt++)
++ {
++ switch(c)
++ {
++ case '%':
++ switch(*fmt++)
++ {
++ case 'i':
++ fprintf(stdout, "%d", (int) *arglist++);
++ break;
++ case 's':
++ fputs(*arglist++, stdout);
++ break;
++ case '%':
++ default:
++ fputc('%', stdout);
++ break;
++ }
++ break;
++
++ default:
++ fputc(c, stdout);
++ break;
++ }
++ }
++ }
++