Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!tektronix!reed!nscpdc!rgb From: rgb@nscpdc.NSC.COM (Robert Bond) Newsgroups: comp.sources.bugs Subject: Sc4.1 bug and fix Message-ID: <946@nscpdc.NSC.COM> Date: Wed, 21-Oct-87 17:03:44 EDT Article-I.D.: nscpdc.946 Posted: Wed Oct 21 17:03:44 1987 Date-Received: Sat, 24-Oct-87 10:16:49 EDT Reply-To: rgb@nscpdc.UUCP (Robert Bond) Organization: NSC Portland, Oregon Lines: 58 There is a problem in version 4.1 of sc. Defined range names are not deleted when a new data base is loaded with a G (get) command. This causes trouble because the range names then point at wrong (or deleted!) cells. Also, new ranges by the same name cannot be loaded into the spread sheet. Here is the fix. Point this file at the source directory as patch -d < file ------------------------- diffs for range.c----------------------- *** range.c.b Wed Oct 21 13:34:31 1987 --- range.c Wed Oct 21 13:36:17 1987 *************** *** 77,82 **** --- 77,98 ---- xfree((char *)r); } + clean_range() + { + register struct range *r; + register struct range *nextr; + + r = rng_base; + rng_base = 0; + + while (r) { + nextr = r->r_next; + xfree((char *)(r->r_name)); + xfree((char *)r); + r = nextr; + } + } + /* Match on name or lmatch, rmatch */ struct range * ------------ diffs for sc.c ---------------------- *** sc.c.b Wed Oct 21 13:37:11 1987 --- sc.c Wed Oct 21 13:37:56 1987 *************** *** 1006,1011 **** --- 1006,1012 ---- *p = 0; } } + clean_range(); maxrow = 0; maxcol = 0; FullUpdate++; -- Robert Bond ihnp4!nsc!nscpdc!rgb National Semiconductor tektronix!nscpdc!rgb