commit-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Mailutils branch, master, updated. mu-1-2-90-separate-argp-cfg


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. mu-1-2-90-separate-argp-cfg-319-g73fe929
Date: Thu, 13 Aug 2009 12:21:22 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=73fe9290251b13e7e5d978a6bfbe014499f87e36

The branch, master has been updated
       via  73fe9290251b13e7e5d978a6bfbe014499f87e36 (commit)
      from  eee2dde23b558aecd59b690ff9007341869577cb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 73fe9290251b13e7e5d978a6bfbe014499f87e36
Author: Sergey Poznyakoff <address@hidden>
Date:   Thu Aug 13 15:12:50 2009 +0300

    Fix building with fribidi2
    
    * configure.ac: Check for wcwidth and wchar.h.
    * frm/common.c (get_charset): Aways allocate output_charset.
    Provide a substitution for fribidi_wcwidth if it is not
    available.
    (puts_bidi): Use mu_fribidi_wcwidth.

-----------------------------------------------------------------------

Summary of changes:
 configure.ac |    4 +++-
 frm/common.c |   34 ++++++++++++++++++++++++----------
 2 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/configure.ac b/configure.ac
index 954cf7f..f9ddd2e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -409,7 +409,7 @@ AC_HEADER_DIRENT
 AC_CHECK_HEADERS(errno.h fcntl.h inttypes.h libgen.h limits.h\
  malloc.h obstack.h paths.h shadow.h socket.h sys/socket.h stdarg.h stdio.h\
  stdlib.h string.h strings.h sys/file.h sysexits.h syslog.h termcap.h\
- termios.h termio.h sgtty.h utmp.h utmpx.h unistd.h)
+ termios.h termio.h sgtty.h utmp.h utmpx.h unistd.h wchar.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
@@ -536,6 +536,8 @@ AH_BOTTOM([
 
 ## FriBidi support
 
+AC_CHECK_FUNCS(wcwidth)
+
 AC_SUBST(FRIBIDI_LIBS)
 
 use_fribidi=yes
diff --git a/frm/common.c b/frm/common.c
index 77f0685..4cd4f71 100644
--- a/frm/common.c
+++ b/frm/common.c
@@ -62,10 +62,10 @@ static char *output_charset = NULL;
 const char *
 get_charset ()
 {
-  char *tmp;
-  
   if (!output_charset)
     {
+      char *tmp;
+      const char *str = NULL;
       char locale[32];
       
       memset (locale, 0, sizeof (locale));
@@ -86,16 +86,16 @@ get_charset ()
          
          lang = strtok_r (locale, "_", &sp);
          terr = strtok_r (NULL, ".", &sp);
-         output_charset = strtok_r (NULL, "@", &sp);
+         str = strtok_r (NULL, "@", &sp);
 
-         if (output_charset)
-           output_charset = xstrdup (output_charset);
-         else
-           output_charset = mu_charset_lookup (lang, terr);
+         if (!str)
+           str = mu_charset_lookup (lang, terr);
        }
       
-      if (!output_charset)
-       output_charset = "ASCII";
+      if (!str)
+       str = "ASCII";
+
+      output_charset = xstrdup (str);
     }
   return output_charset;
 }
@@ -104,6 +104,20 @@ get_charset ()
 /* BIDI support (will be moved to lib when it's ready) */
 #ifdef HAVE_LIBFRIBIDI
 
+# ifdef HAVE_FRIBIDI_WCWIDTH
+#  define mu_fribidi_wcwidth fribidi_wcwidth
+# else
+#  if defined(HAVE_WCHAR_H) && defined(HAVE_WCWIDTH)
+#   include <wchar.h>
+#   define mu_fribidi_wcwidth(c) wcwidth((wchar_t)c)
+#  else
+#   undef HAVE_LIBFRIBIDI
+#  endif
+# endif
+#endif
+
+#ifdef HAVE_LIBFRIBIDI
+
 static int fb_charset_num = -1;
 FriBidiChar *logical;
 char *outstring;
@@ -170,7 +184,7 @@ puts_bidi (char *string)
              if (fb_charset_num != FRIBIDI_CHARSET_CAP_RTL)
                {
                  while (wid > 0 && idx < len)
-                   wid -= fribidi_wcwidth (visual[idx++]);
+                   wid -= mu_fribidi_wcwidth (visual[idx++]);
                }
              else
                {


hooks/post-receive
-- 
GNU Mailutils




reply via email to

[Prev in Thread] Current Thread [Next in Thread]