| 72 |
|
|
| 73 |
|
|
| 74 |
|
MESH * |
| 75 |
< |
getmesh( /* get new mesh data reference */ |
| 75 |
> |
getmesh( /* get mesh data reference */ |
| 76 |
|
char *mname, |
| 77 |
|
int flags |
| 78 |
|
) |
| 82 |
|
|
| 83 |
|
flags &= IO_LEGAL; |
| 84 |
|
for (ms = mlist; ms != NULL; ms = ms->next) |
| 85 |
< |
if (!strcmp(mname, ms->name)) { |
| 86 |
< |
ms->nref++; /* increase reference count */ |
| 85 |
> |
if (!strcmp(mname, ms->name)) |
| 86 |
|
break; |
| 88 |
– |
} |
| 87 |
|
if (ms == NULL) { /* new mesh entry? */ |
| 88 |
|
ms = (MESH *)calloc(1, sizeof(MESH)); |
| 89 |
|
if (ms == NULL) |
| 90 |
|
error(SYSTEM, "out of memory in getmesh"); |
| 91 |
|
ms->name = savestr(mname); |
| 94 |
– |
ms->nref = 1; |
| 92 |
|
ms->mcube.cutree = EMPTY; |
| 93 |
|
ms->next = mlist; |
| 94 |
|
mlist = ms; |
| 95 |
|
} |
| 96 |
+ |
ms->nref++; /* bump reference count */ |
| 97 |
|
if (!(flags &= ~ms->ldflags)) /* nothing to load? */ |
| 98 |
|
return(ms); |
| 99 |
|
if ((pathname = getpath(mname, getrlibpath(), R_OK)) == NULL) { |