version 1.12, 2009/10/27 23:59:40 |
version 1.13, 2015/10/16 17:56:07 |
|
|
h = hash(name); |
h = hash(name); |
vp = lookup(name); |
vp = lookup(name); |
if (vp == NULL) { |
if (vp == NULL) { |
if ((vp = (struct var *)calloc(1, sizeof(*vp))) == NULL) |
if ((vp = calloc(1, sizeof(*vp))) == NULL) |
errx(1, "Out of memory"); |
err(1, "calloc"); |
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; |
|
|
if (*str == '\0') |
if (*str == '\0') |
return(""); |
return(""); |
if ((new = strdup(str)) == NULL) |
if ((new = strdup(str)) == NULL) |
errx(1, "Out of memory"); |
err(1, "strdup"); |
return(new); |
return(new); |
} |
} |
|
|