version 1.21, 2023/03/22 18:18:35 |
version 1.22, 2023/03/22 19:42:41 |
|
|
* l, and can be freed during cleanup. |
* l, and can be freed during cleanup. |
*/ |
*/ |
int |
int |
addctag(char *l) |
addctag(char *s) |
{ |
{ |
struct ctag *t = NULL; |
struct ctag *t = NULL; |
|
char *l; |
|
|
if ((t = malloc(sizeof(struct ctag))) == NULL) { |
if ((t = malloc(sizeof(struct ctag))) == NULL) { |
dobeep(); |
dobeep(); |
ewprintf("Out of memory"); |
ewprintf("Out of memory"); |
goto cleanup; |
goto cleanup; |
} |
} |
t->tag = l; |
t->tag = s; |
if ((l = strchr(l, '\t')) == NULL) |
if ((l = strchr(s, '\t')) == NULL) |
goto cleanup; |
goto cleanup; |
*l++ = '\0'; |
*l++ = '\0'; |
t->fname = l; |
t->fname = l; |
|
|
return (TRUE); |
return (TRUE); |
cleanup: |
cleanup: |
free(t); |
free(t); |
free(l); |
free(s); |
return (FALSE); |
return (FALSE); |
} |
} |
|
|