This is *REALLY* a pile of shit

This commit is contained in:
espie 2005-11-05 09:28:42 +00:00
parent fe54538e4f
commit f5d7844b9c
4 changed files with 90 additions and 2 deletions

View File

@ -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/

View File

@ -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;
}

View File

@ -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

View File

@ -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++) {