From 4dc5838cccc1ad033b06173aca732aa8a578086e Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Tue, 15 Mar 2005 06:58:02 +0000 Subject: [PATCH] =?utf8?q?in=20do=5Fcredits(),=20display=20Florian=20K?= =?utf8?q?=C3=B6nig's=20name=20properly=20in=20UTF-8=20mode;=20since=20we?= =?utf8?q?=20can't=20dynamically=20set=20that=20element=20of=20the=20array?= =?utf8?q?=20to=20its=20UTF-8=20equivalent=20when=20in=20UTF-8=20mode,=20w?= =?utf8?q?e=20have=20to=20use=20the=20ISO-8859-1=20version=20and=20pass=20?= =?utf8?q?every=20string=20in=20the=20credits=20through=20make=5Fmbstring(?= =?utf8?q?)=20to=20make=20sure=20they're=20all=20UTF-8=20(sigh)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2373 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- src/winio.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/winio.c b/src/winio.c index e5044f31..6a667df9 100644 --- a/src/winio.c +++ b/src/winio.c @@ -4120,17 +4120,22 @@ void do_credits(void) break; if (crpos < CREDIT_LEN) { - const char *what = credits[crpos]; + char *what; size_t start_x; - if (what == NULL) { + if (credits[crpos] == NULL) { assert(0 <= xlpos && xlpos < XLCREDIT_LEN); - what = _(xlcredits[xlpos]); + + what = mallocstrcpy(NULL, _(xlcredits[xlpos])); xlpos++; - } + } else + what = make_mbstring(credits[crpos]); + start_x = COLS / 2 - strlenpt(what) / 2 - 1; - mvwaddstr(edit, editwinrows - 1 - editwinrows % 2, start_x, - what); + mvwaddstr(edit, editwinrows - 1 - (editwinrows % 2), + start_x, what); + + free(what); } napms(700); -- 2.39.5