More iconv-related patches from EGE.
authorThomas Roessler <roessler@does-not-exist.org>
Mon, 15 May 2000 12:00:53 +0000 (12:00 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Mon, 15 May 2000 12:00:53 +0000 (12:00 +0000)
configure.in
mbyte.c
pager.c

index e2288259ad67ba8f2cfbc5705a80974100229c73..46dbbb0248ff40eeb6d9f75aa3e582a023f7b9ed 100644 (file)
@@ -400,7 +400,12 @@ AC_ARG_WITH(sharedir, [  --with-sharedir=PATH       Specify where to put arch in
 sharedir=$mutt_cv_sharedir
 AC_SUBST(sharedir)
 
-AC_ARG_WITH(iconv, [  --with-iconv               Use system's iconv], [
+LIBICONV=
+LIBICONVDEPS=
+need_iconv=no
+AC_ARG_WITH(included-iconv,
+  [  --with-included-iconv      Use the iconv implementation included here],
+  need_iconv=yes,
   AC_CACHE_CHECK(for iconv, mutt_cv_func_iconv,
     [ mutt_cv_func_iconv=no
       mutt_cv_lib_iconv=no
@@ -420,18 +425,18 @@ AC_ARG_WITH(iconv, [  --with-iconv               Use system's iconv], [
       fi
     ])
   if test "$mutt_cv_func_iconv" = no; then
-    AC_MSG_ERROR(No iconv)
+    need_iconv=yes
   fi
-  LIBICONV=
   if test "$mutt_cv_lib_iconv" = yes; then
     LIBICONV="-liconv"
   fi
-  need_iconv=no
-],
-[ LIBICONV="-Liconv -liconv"
+)
+
+if test "$need_iconv" = yes ; then
+  LIBICONV="-Liconv -liconv"
   LIBICONVDEPS="\$(top_srcdir)/iconv/iconv.h iconv/libiconv.a"
-  need_iconv=yes
-])
+fi
+
 AM_CONDITIONAL(BUILD_ICONV, test "$need_iconv" = yes)
 AC_SUBST(LIBICONV)
 AC_SUBST(LIBICONVDEPS)
diff --git a/mbyte.c b/mbyte.c
index 2d99389ef61e349b61a4528b638ff0c48aa9d22f..ee6eab56dd55b13e079feab74480acff964111b3 100644 (file)
--- a/mbyte.c
+++ b/mbyte.c
@@ -22,12 +22,13 @@ void mutt_set_charset (char *charset)
 
 int wctomb (char *s, wchar_t wc)
 {
+  if (!s)
+    return 0;
   if (Charset_is_utf8)
     return mutt_wctoutf8 (s, wc);
   else if (wc < 0x100)
   {
-    if (s)
-      *s = wc;
+    *s = wc;
     return 1;
   }
   else
diff --git a/pager.c b/pager.c
index f7d956d9b2dd81f1532d07a5a478ba5cc510a17e..999290ae4f5fb2a14ddd1db23f5017371c032941 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -1004,7 +1004,7 @@ static int format_line (struct line_t **lineInfo, int n, unsigned char *buf,
       continue;
     }
     if (k == 0)
-      k = wctomb (0, wc);
+      k = 1;
 
     /* Handle backspace */
     special = 0;