summaryrefslogtreecommitdiff
path: root/bk_text.c
diff options
context:
space:
mode:
Diffstat (limited to 'bk_text.c')
-rw-r--r--bk_text.c27
1 files changed, 2 insertions, 25 deletions
diff --git a/bk_text.c b/bk_text.c
index 499f232..ce4492d 100644
--- a/bk_text.c
+++ b/bk_text.c
@@ -85,7 +85,7 @@ static textconfig text_configure(paragraph *source) {
ret.indent = utoi(uadv(source->keyword));
} else if (!ustricmp(source->keyword, L"text-filename")) {
sfree(ret.filename);
- ret.filename = utoa_dup(uadv(source->keyword));
+ ret.filename = dupstr(adv(source->origkeyword));
} else if (!ustricmp(source->keyword, L"text-indent-code")) {
ret.indent_code = utoi(uadv(source->keyword));
} else if (!ustricmp(source->keyword, L"text-width")) {
@@ -182,30 +182,7 @@ static textconfig text_configure(paragraph *source) {
paragraph *text_config_filename(char *filename)
{
- paragraph *p;
- wchar_t *ufilename, *up;
- int len;
-
- p = mknew(paragraph);
- memset(p, 0, sizeof(*p));
- p->type = para_Config;
- p->next = NULL;
- p->fpos.filename = "<command line>";
- p->fpos.line = p->fpos.col = -1;
-
- ufilename = ufroma_dup(filename);
- len = ustrlen(ufilename) + 2 + lenof(L"text-filename");
- p->keyword = mknewa(wchar_t, len);
- up = p->keyword;
- ustrcpy(up, L"text-filename");
- up = uadv(up);
- ustrcpy(up, ufilename);
- up = uadv(up);
- *up = L'\0';
- assert(up - p->keyword < len);
- sfree(ufilename);
-
- return p;
+ return cmdline_cfg_simple("text-filename", filename, NULL);
}
void text_backend(paragraph *sourceform, keywordlist *keywords,