summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authormjl <mjl>2002-02-16 15:10:57 +0000
committermjl <mjl>2002-02-16 15:10:57 +0000
commit011ca6ff102a32e9787eeea96699966e3fc63f95 (patch)
treebc34bbf45ce171a61f94f3fae075855e610ac3b7 /graphics
parent028cfabbcab20b9a7706a2719841fd139ecd278f (diff)
downloadpkgsrc-011ca6ff102a32e9787eeea96699966e3fc63f95.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')
-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;
++ }
++ }
++ }
++