AC_FUNC_MMAP
AC_FUNC_FSEEKO
AC_CHECK_FUNCS(strptime timegm snprintf vsnprintf vasprintf drand48)
-AC_CHECK_FUNCS(strtoll usleep ftello sigblock sigsetjmp memrchr wcwidth)
+AC_CHECK_FUNCS(strtoll usleep ftello sigblock sigsetjmp memrchr wcwidth mbtowc)
if test x"$ENABLE_OPIE" = xyes; then
AC_LIBOBJ([ftp-opie])
#endif
}
-#if ! HAVE_WCWIDTH
-#define wcwidth(wc) (1)
-#endif
-
+#if HAVE_MBTOWC && HAVE_WCWIDTH
int
count_cols (const char *mbs)
{
}
return cols;
}
+#else
+# define count_cols(mbs) ((int)(strlen(mbs)))
+# undef wcwidth
+# define wcwidth(wc) (1)
+#endif
/* Translation note: "ETA" is English-centric, but this must
be short, ideally 3 chars. Abbreviate if necessary. */
int nbytes;
int ncols;
+#if HAVE_WCWIDTH && HAVE_MBTOWC
eta_trans = _(eta_str);
+#else
+ eta_trans = eta_str;
+#endif
/* Determine the number of bytes used in the translated string,
* versus the number of columns used. This is to figure out how
struct lconv *lconv = localeconv ();
cached_sep = lconv->thousands_sep;
cached_grouping = lconv->grouping;
+#if ! USE_NLS_PROGRESS_BAR
+ /* We can't count column widths, so ensure that the separator
+ * is single-byte only (let check below determine what byte). */
+ if (strlen(cached_sep) > 1)
+ cached_sep = "";
+#endif
if (!*cached_sep)
{
/* Many locales (such as "C" or "hr_HR") don't specify
variables. -- explanation partly taken from GNU make. */
#define N_(string) string
+#if ! ENABLE_NLS
+# undef HAVE_WCHAR_H
+# undef HAVE_WCWIDTH
+# undef HAVE_MBTOWC
+#endif /* not ENABLE_NLS */
+
+#if HAVE_WCWIDTH && HAVE_MBTOWC
+# define USE_NLS_PROGRESS_BAR 1
+#else
+/* Just to be a little paranoid about it. */
+# undef USE_NLS_PROGRESS_BAR
+#endif
+
/* I18N NOTE: You will notice that none of the DEBUGP messages are
marked as translatable. This is intentional, for a few reasons: