diff options
| author | Steve Price <steve@FreeBSD.org> | 2000-01-24 06:19:03 +0000 |
|---|---|---|
| committer | Steve Price <steve@FreeBSD.org> | 2000-01-24 06:19:03 +0000 |
| commit | d80572ef7327df981c91c314d7a450e3a9684ea1 (patch) | |
| tree | 5a4b19e15869f9899f7841f156c0e8f758d462d8 /math/gnuplot+/files/patch-xe | |
| parent | 0d2056a4f130c73bc5549a1c1d720d85b2839c19 (diff) | |
o Fix Configuration Option for readline library
o Add patch to avoid divide-by-zero trap
o Merge patches for gnuplot-3.7.1
PR: 16120
Submitted by: Akio Morita <amorita@meadow.scphys.kyoto-u.ac.jp>
Reviewed by: maintainer
Diffstat (limited to 'math/gnuplot+/files/patch-xe')
| -rw-r--r-- | math/gnuplot+/files/patch-xe | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/math/gnuplot+/files/patch-xe b/math/gnuplot+/files/patch-xe new file mode 100644 index 000000000000..cc9cb87da290 --- /dev/null +++ b/math/gnuplot+/files/patch-xe @@ -0,0 +1,80 @@ +# contour.c.fix.991130 +--- contour.c.ORIG Thu Dec 3 22:23:46 1998 ++++ contour.c Wed Dec 1 21:07:24 1999 +@@ -536,8 +536,8 @@ + struct edge_struct **p_edges; /* list of edges output */ + { + int i, j, grid_x_max = iso_lines->p_count; +- struct edge_struct *p_edge1, *p_edge2, *edge0, *edge1, *edge2, *pe_tail, +- *pe_tail1, *pe_tail2, *pe_temp; ++ struct edge_struct *p_edge1, *p_edge2, *edge0, *edge1, *edge2, ++ *pe_tail, *pe_tail2, *pe_temp; + struct poly_struct *pp_tail, *lower_tri, *upper_tri; + struct coordinate GPHUGE *p_vrtx1, GPHUGE * p_vrtx2; /* HBB 980308: need to tag *each* of them as GPHUGE! */ + +@@ -545,14 +545,14 @@ + (*p_edges) = pe_tail = NULL; + + p_vrtx1 = iso_lines->points; /* first row of vertices */ +- p_edge1 = pe_tail1 = NULL; /* clear list of edges */ ++ p_edge1 = pe_tail = NULL; /* clear list of edges */ + + /* Generate edges of first row */ ++ /* HBB 19991130: removed effectively unused variable 'pe_tail1' */ + for (j = 0; j < grid_x_max - 1; j++) +- add_edge(p_vrtx1 + j, p_vrtx1 + j + 1, &p_edge1, &pe_tail1); ++ add_edge(p_vrtx1 + j, p_vrtx1 + j + 1, &p_edge1, &pe_tail); + + (*p_edges) = p_edge1; /* update main list */ +- pe_tail = pe_tail1; + + + /* +@@ -562,10 +562,16 @@ + * (pe_tail points on last edge). + * + * Temporary pointers: +- * 1. p_edge2: Top horizontal edge list: ----------------------- 2 +- * 2. pe_tail: middle edge list: |\ |\ |\ |\ |\ |\ | ++ * 1. p_edge2: Top horizontal edge list: +-----------------------+ 2 ++ * 2. p_tail : end of middle edge list: |\ |\ |\ |\ |\ |\ | + * | \| \| \| \| \| \| +- * 3. p_edge1: Bottom horizontal edge list: ----------------------- 1 ++ * 3. p_edge1: Bottom horizontal edge list: +-----------------------+ 1 ++ * ++ * pe_tail2 : end of list beginning at p_edge2 ++ * pe_temp : position inside list beginning at p_edge1 ++ * p_edges : head of the master edge list (part of our output) ++ * p_vrtx1 : start of lower row of input vertices ++ * p_vrtx2 : start of higher row of input vertices + * + * The routine generates two triangle Lower Upper 1 + * upper one and lower one: | \ ---- +@@ -633,14 +639,21 @@ + upper_tri = add_poly(edge0, edge1, edge2, p_polys, &pp_tail); + } + +- if ((*p_edges)) { /* Chain new edges to main list. */ +- pe_tail->next = p_edge2; +- pe_tail = pe_tail2; +- } else { +- (*p_edges) = p_edge2; +- pe_tail = pe_tail2; ++ if (p_edge2) { ++ /* HBB 19991130 bugfix: if p_edge2 list is empty, ++ * don't change p_edges list! Crashes by access ++ * to NULL pointer pe_tail, the second time through, ++ * otherwise */ ++ if ((*p_edges)) { /* Chain new edges to main list. */ ++ pe_tail->next = p_edge2; ++ pe_tail = pe_tail2; ++ } else { ++ (*p_edges) = p_edge2; ++ pe_tail = pe_tail2; ++ } + } + ++ /* this row finished, move list heads up one row: */ + p_edge1 = p_edge2; + p_vrtx1 = p_vrtx2; + } |
