From 992045e7f3da4519e0820502bb78513ba373d903 Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Fri, 27 Oct 2017 19:58:49 -0600 Subject: [PATCH] * When the locale is not set up to UTF-8, alpine might determine the width of a character incorrectly. Reported by Alexandre Fedotov. --- alpine/alpine.c | 11 ++++++++--- pico/osdep/mswin.rc | 4 ++-- pith/pine.hlp | 5 ++++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/alpine/alpine.c b/alpine/alpine.c index 022fc54..a9c9158 100644 --- a/alpine/alpine.c +++ b/alpine/alpine.c @@ -312,9 +312,14 @@ main(int argc, char **argv) * in the screen, so this is not necessary to do in Window, and * using pith_ucs4width does not produce the correct result */ -#ifndef _WINDOWS - mail_parameters(NULL, SET_UCS4WIDTH, (void *) pith_ucs4width); -#endif /* _WINDOWS */ +#if !defined(_WINDOWS) && defined(LC_CTYPE) + { char *s; + if((s = setlocale(LC_CTYPE, "")) != NULL + && strlen(s) >= 5 + && !strucmp(s+strlen(s)-5, "UTF-8")) + mail_parameters(NULL, SET_UCS4WIDTH, (void *) pith_ucs4width); + } +#endif /* !_WINDOWS && LC_CTYPE */ mail_parameters(NULL, SET_QUOTA, (void *) pine_parse_quota); /* set some default timeouts in case pinerc is remote */ mail_parameters(NULL, SET_OPENTIMEOUT, (void *)(long)30); diff --git a/pico/osdep/mswin.rc b/pico/osdep/mswin.rc index 0f00ef4..e930503 100644 --- a/pico/osdep/mswin.rc +++ b/pico/osdep/mswin.rc @@ -189,8 +189,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 5,05,0,0 - PRODUCTVERSION 5,05,0,0 + FILEVERSION 5,09,0,0 + PRODUCTVERSION 5,09,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L diff --git a/pith/pine.hlp b/pith/pine.hlp index 9774281..c126286 100644 --- a/pith/pine.hlp +++ b/pith/pine.hlp @@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any reasonable place to be called from. Dummy change to get revision in pine.hlp ============= h_revision ================= -Alpine Commit 223 2017-09-30 11:55:59 +Alpine Commit 224 2017-10-27 19:58:37 ============= h_news ================= @@ -206,6 +206,9 @@ Bugs that have been addressed include:
  • Update build.bat file to add /DWINVER=0x0501 so that Alpine can build when using Visual Studio 2017. Fix contributed by Ulf-Dietrich Braunmann. + +
  • When the locale is not set up to UTF-8, alpine might determine the + width of a character incorrectly. Reported by Alexandre Fedotov.

    -- 2.11.4.GIT