From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from carson.u.washington.edu ([140.142.52.11]) by hawkwind.utcs.toronto.edu with SMTP id <2773>; Mon, 12 Oct 1992 19:54:58 -0400 Received: by carson.u.washington.edu (5.65/UW-NDC Revision: 2.22 ) id AA16285; Mon, 12 Oct 92 16:54:44 -0700 Date: Mon, 12 Oct 1992 19:54:44 -0400 From: Donn Cave Message-Id: <9210122354.AA16285@carson.u.washington.edu> Sender: donn@carson.u.washington.edu To: rc@hawkwind.utcs.toronto.edu Subject: segv on 0-length var Following up on this bug: ; Z='' rc ; whatis Z Z='' ; Z = ouch segmentation violation--core dumped ; The appended patch seems to fix it. The problem arises when listfree() attempts to free the variable value. The patch is against version 1.4. Donn Cave, University Computing Services, University of Washington donn@cac.washington.edu ------------------------------- *** footobar.c.dist Fri Feb 14 09:05:01 1992 --- footobar.c Mon Oct 12 15:49:28 1992 *************** *** 260,266 **** top = r = enew(List); extdef = strchr(extdef, '=') + 1; if ((f = getenvw(extdef, FALSE)) == NULL) { ! r->w = ""; r->m = NULL; r->n = NULL; } else { --- 260,267 ---- top = r = enew(List); extdef = strchr(extdef, '=') + 1; if ((f = getenvw(extdef, FALSE)) == NULL) { ! r->w = ealloc (1); ! r->w[0] = 0; r->m = NULL; r->n = NULL; } else {