From 1eaa01608b8367078b19e48dd10ba9e39ece5f4b Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Mon, 15 May 2000 12:00:53 +0000 Subject: [PATCH] More iconv-related patches from EGE. --- configure.in | 21 +++++++++++++-------- mbyte.c | 5 +++-- pager.c | 2 +- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/configure.in b/configure.in index e2288259..46dbbb02 100644 --- a/configure.in +++ b/configure.in @@ -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 2d99389e..ee6eab56 100644 --- 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 f7d956d9..999290ae 100644 --- 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; -- 2.50.1