X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/halibut/blobdiff_plain/5b1d0032b0eb6f4a347c0c2cfdbe6e4bb4f959ab..60daa966e8090794ec307cddebf296f0cc0a3f20:/bk_info.c diff --git a/bk_info.c b/bk_info.c index 5c05817..48ad45e 100644 --- a/bk_info.c +++ b/bk_info.c @@ -134,9 +134,7 @@ static infoconfig info_configure(paragraph *source) { sfree(ret.filename); ret.filename = dupstr(adv(p->origkeyword)); } else if (!ustricmp(p->keyword, L"info-charset")) { - char *csname = utoa_dup(uadv(p->keyword), CS_ASCII); - ret.charset = charset_from_localenc(csname); - sfree(csname); + ret.charset = charset_from_ustr(&p->fpos, uadv(p->keyword)); } else if (!ustricmp(p->keyword, L"info-max-file-size")) { ret.maxfilesize = utoi(uadv(p->keyword)); } else if (!ustricmp(p->keyword, L"info-width")) { @@ -269,6 +267,9 @@ void info_backend(paragraph *sourceform, keywordlist *keywords, currnode = newnode; } break; + default: + p->private_data = NULL; + break; } /* @@ -279,7 +280,7 @@ void info_backend(paragraph *sourceform, keywordlist *keywords, indexentry *entry; for (i = 0; (entry = index234(idx->entries, i)) != NULL; i++) { - info_idx *ii = mknew(info_idx); + info_idx *ii = snew(info_idx); info_data id = EMPTY_INFO_DATA; id.charset = conf.charset; @@ -631,7 +632,7 @@ void info_backend(paragraph *sourceform, keywordlist *keywords, if (fp) fclose(fp); - fname = mknewa(char, strlen(conf.filename) + 40); + fname = snewn(strlen(conf.filename) + 40, char); sprintf(fname, "%s-%d", conf.filename, filenum); fp = fopen(fname, "w"); if (!fp) { @@ -678,7 +679,7 @@ static int info_check_index(word *w, node *n, indexdata *idx) if (ii->nnodes >= ii->nodesize) { ii->nodesize += 32; - ii->nodes = resize(ii->nodes, ii->nodesize); + ii->nodes = sresize(ii->nodes, ii->nodesize, node *); } ii->nodes[ii->nnodes++] = n; @@ -708,7 +709,7 @@ static word *info_transform_wordlist(word *words, keywordlist *keywords) * In Info, we do nothing special for xrefs to * numbered list items or bibliography entries. */ - break; + continue; } else { /* * An xref to a different section has its text @@ -1024,7 +1025,7 @@ static node *info_node_new(char *name, int charset) { node *n; - n = mknew(node); + n = snew(node); n->text = empty_info_data; n->text.charset = charset; n->up = n->next = n->prev = n->lastchild = n->listnext = NULL;