version 1.3, 1997/07/13 21:21:18 |
version 1.4, 1997/07/13 23:54:03 |
|
|
h = hash(name); |
h = hash(name); |
vp = lookup(name); |
vp = lookup(name); |
if (vp == NOVAR) { |
if (vp == NOVAR) { |
vp = (struct var *) calloc(sizeof(*vp), 1); |
vp = (struct var *)calloc(sizeof(*vp), 1); |
vp->v_name = vcopy(name); |
vp->v_name = vcopy(name); |
vp->v_link = variables[h]; |
vp->v_link = variables[h]; |
variables[h] = vp; |
variables[h] = vp; |
|
|
char *cp; |
char *cp; |
{ |
{ |
if (*cp) |
if (*cp) |
free(cp); |
(void)free(cp); |
} |
} |
|
|
/* |
/* |
|
|
if (*str == '\0') |
if (*str == '\0') |
return(""); |
return(""); |
len = strlen(str) + 1; |
len = strlen(str) + 1; |
if ((new = malloc(len)) == NULL) |
if ((new = (char *)malloc(len)) == NULL) |
panic("Out of memory"); |
panic("Out of memory"); |
bcopy(str, new, (int) len); |
(void)memcpy(new, str, len); |
return(new); |
return(new); |
} |
} |
|
|