diff options
-rw-r--r-- | libwc/ucs.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libwc/ucs.c b/libwc/ucs.c index 4fe020d..288014e 100644 --- a/libwc/ucs.c +++ b/libwc/ucs.c @@ -702,8 +702,13 @@ wtf_push_ucs(Str os, wc_uint32 ucs, wc_status *st) if (! WcOption.use_language_tag) return; if (ucs == WC_C_LANGUAGE_TAG) - st->tag = Strnew_size(MAX_TAG_LEN); + if (st->tag) + Strclear(st->tag); + else + st->tag = Strnew_size(MAX_TAG_LEN); else if (ucs == WC_C_CANCEL_TAG) { + if (st->tag) + Strfree(st->tag); st->tag = NULL; st->ntag = 0; } else if (st->tag && st->tag->length < MAX_TAG_LEN && |