problems with fig

Will Dickson will%robots.oxford.ac.uk at nss.cs.ucl.ac.uk
Wed Feb 8 10:58:38 AEST 1989


We have also had some trouble with fig, some of which have been fixed in
fig-fs (along with the addition of some new facilities).  The problem
mentioned by peirce at gumby.cc.wmich.edu also stayed hidden until we
upgraded to 4.0: it is a question of initialising all the pointers of the
structure obj in read_objects in read.c (fix below).  This has been fixed
in fig-fs.  Below is a summary of all the mods I applied to fig-fs to make
it work.  The first stops fig from crashing out when points are deleted
from splines; the other prevents infinite looping for zero height
ellipses.

******************************

Script started on Fri Jan 13 11:50:46 1989
miranda:1% diff deletept.c deletept.c.OLD
100,102c100
< /* JWD fix 25-10-88 */
< /*            if (n <= 1) {*/
<             if (n <= 2) {
---
>               if (n <= 1) {
107,114c105,108
< /* JWD fix 25-10-88 */
< /*        else if (n <= 2) {*/ /* it must be an interpolated spline */
< /*            put_msg("An interpolated spline may have less than 3 points");
< */
<           else if (n <= 3) {
<             put_msg("An interpolated spline cannot have less than 3 points");
<             return;
<           }
---
>           else if (n <= 2) { /* it must be an interpolated spline */
>               put_msg("An interpolated spline may have less than 3 points");
>               return;
>               }
miranda:2% diff ellipse.c ellipse.c.OLD
116,124d115
< 
< /* JWD mod 25-10-88 */
<       if ((x == fix_x) || (y == fix_y))
<         {
<           put_msg("cannot create flat ellipse !");
<           return;
<         }
< /* end JWD mod */
< 
miranda:3% exit

script done on Fri Jan 13 11:53:05 1989

******************************

The fix for read.c (fig only, not fig-fs) is:

******************************

Script started on Fri Jan 13 11:56:42 1989
miranda:1% diff read.c read.c.oldOLD
114,125d113
< /* Modification by JWD to initialise pointers... not done otherwise. */
< /* 5-JAN-89 JWD */
< 
<       obj->lines = NULL;
<       obj->ellipses = NULL;
<       obj->splines = NULL;
<       obj->texts = NULL;
<       obj->arcs = NULL;
<       obj->compounds = NULL;
< 
< /* End of JWD mod 5-JAN-89 */
< 
miranda:2% exit

script done on Fri Jan 13 11:57:00 1989

******************************

The patch mentioned by peirce at gumby.cc.wmich.edu appears to be intended
for the fig-fs distribution (which includes fig2tex etc...).

There is still another bug somewhere in fig-fs which causes a crash very
occasionally, but only after very prolonged sessions and not in repeatable
circumstances.  If anyone has found anything like this, please let us
know!

Will Dickson,
Robotics Research Group,
19 Parks Road,
Oxford OX1 3PJ,
ENGLAND.			JANET: will at uk.ac.ox.robots



More information about the Comp.sys.sun mailing list