From f5d7844b9cb1dbcf0ee3f17706e252e660285c6d Mon Sep 17 00:00:00 2001 From: espie Date: Sat, 5 Nov 2005 09:28:42 +0000 Subject: [PATCH] This is *REALLY* a pile of shit --- misc/magicpoint/Makefile | 4 +-- misc/magicpoint/patches/patch-grammar_y | 35 +++++++++++++++++++++++++ misc/magicpoint/patches/patch-mgp_h | 24 +++++++++++++++++ misc/magicpoint/patches/patch-parse_c | 29 ++++++++++++++++++++ 4 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 misc/magicpoint/patches/patch-grammar_y create mode 100644 misc/magicpoint/patches/patch-mgp_h create mode 100644 misc/magicpoint/patches/patch-parse_c diff --git a/misc/magicpoint/Makefile b/misc/magicpoint/Makefile index 7cf654d979c..ec92eb36dfa 100644 --- a/misc/magicpoint/Makefile +++ b/misc/magicpoint/Makefile @@ -1,10 +1,10 @@ -# $OpenBSD: Makefile,v 1.41 2005/11/03 18:28:56 naddy Exp $ +# $OpenBSD: Makefile,v 1.42 2005/11/05 09:28:42 espie Exp $ COMMENT= "X11-based presentation tool" DISTNAME= magicpoint-1.09a # hack -PKGNAME= magicpoint-1.11bp3 +PKGNAME= magicpoint-1.11bp4 CATEGORIES= misc productivity MASTER_SITES= ftp://sh.wide.ad.jp/WIDE/free-ware/mgp/ diff --git a/misc/magicpoint/patches/patch-grammar_y b/misc/magicpoint/patches/patch-grammar_y new file mode 100644 index 00000000000..7a2adde0808 --- /dev/null +++ b/misc/magicpoint/patches/patch-grammar_y @@ -0,0 +1,35 @@ +$OpenBSD: patch-grammar_y,v 1.1 2005/11/05 09:28:42 espie Exp $ +--- grammar.y.orig Sat Nov 5 10:10:34 2005 ++++ grammar.y Sat Nov 5 10:15:31 2005 +@@ -145,6 +145,7 @@ gen_double_int(op, v) + return ct; + } + ct->ctf_value = (double)v; ++ ct->ct_type = CTL_DOUBLE; + return ct; + } + +@@ -175,6 +176,7 @@ gen_int(op, v) + return ct; + } + ct->cti_value = v; ++ ct->ct_type = CTL_INT; + return ct; + } + +@@ -190,6 +192,7 @@ gen_str(op, str) + return ct; + } + ct->ctc_value = strdup(str); ++ ct->ct_type = CTL_CHAR; + return ct; + } + +@@ -207,6 +210,7 @@ gen_str2(op, str1, str2) + } + ct->ctc2_value1 = strdup(str1); + ct->ctc2_value2 = strdup(str2); ++ ct->ct_type = CTL_CHAR2; + return ct; + } + diff --git a/misc/magicpoint/patches/patch-mgp_h b/misc/magicpoint/patches/patch-mgp_h new file mode 100644 index 00000000000..4d47479b356 --- /dev/null +++ b/misc/magicpoint/patches/patch-mgp_h @@ -0,0 +1,24 @@ +$OpenBSD: patch-mgp_h,v 1.1 2005/11/05 09:28:42 espie Exp $ +--- mgp.h.orig Sat Nov 5 10:09:50 2005 ++++ mgp.h Sat Nov 5 10:15:33 2005 +@@ -276,6 +276,7 @@ struct ctrl { + u_char ct_flag; + u_int ct_page; + struct ctrl *ct_next; ++ int ct_type; + union { + struct ctrl_double ctrl_double; + struct ctrl_int ctrl_int; +@@ -291,6 +292,12 @@ struct ctrl { + struct ctrl_pcache ctrl_pcache; + } ct_val; + }; ++ ++#define CTL_INT 0 ++#define CTL_CHAR 1 ++#define CTL_CHAR2 2 ++#define CTL_DOUBLE 3 ++#define CTL_LONG 4 + + #define ctf_value ct_val.ctrl_double.ct_value + #define cti_value ct_val.ctrl_int.ct_value diff --git a/misc/magicpoint/patches/patch-parse_c b/misc/magicpoint/patches/patch-parse_c new file mode 100644 index 00000000000..4cb6ee93bed --- /dev/null +++ b/misc/magicpoint/patches/patch-parse_c @@ -0,0 +1,29 @@ +$OpenBSD: patch-parse_c,v 1.1 2005/11/05 09:28:42 espie Exp $ +--- parse.c.orig Sat Nov 5 10:15:39 2005 ++++ parse.c Sat Nov 5 10:20:57 2005 +@@ -355,14 +355,17 @@ read_file(fp, filename, page, line, prea + + case CTL_TAB: + { +- int i = root->cti_value - 1; +- if (i < 0) { +- fprintf(stderr, "%s:%d: " +- "invalid tab index %d\n", +- filename, lineno, root->cti_value); +- exit(-1); +- } +- if (i >= MAXTAB) { /*XXX*/ ++ int i; ++ ++ if (root->ct_type == CTL_INT) { ++ i = root->cti_value - 1; ++ if (i < 0) { ++ fprintf(stderr, "%s:%d: " ++ "invalid tab index %d\n", ++ filename, lineno, root->cti_value); ++ exit(-1); ++ } ++ } else { + /* must be a string */ + /* find a free entry */ + for (i = MAXTAB ; i < MAXTAB + MAXSTYLE ; i++) {