X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Fprogress.c;h=80dab04a1c808102ea58fb5b9734707e7137176b;hp=2db82fda35820e5ee8d4090d0a9fdc66e3ff46b6;hb=e95867e6cc2f21c039f039e845982cdb87cd2cad;hpb=c1b7382ec4c25c23c81a0e0964d94fff72c6a633 diff --git a/src/progress.c b/src/progress.c index 2db82fda..80dab04a 100644 --- a/src/progress.c +++ b/src/progress.c @@ -767,10 +767,7 @@ update_speed_ring (struct bar_progress *bp, wgint howmuch, double dltime) #endif } -#if ! HAVE_WCWIDTH -#define wcwidth(wc) (1) -#endif - +#if HAVE_MBTOWC && HAVE_WCWIDTH int count_cols (const char *mbs) { @@ -796,6 +793,11 @@ 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. */ @@ -811,7 +813,11 @@ get_eta (void) 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