wget-dev
[Top][All Lists]
Advanced

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

Re: [Wget-dev] wget2 | Handle wide characters in download progress bar.


From: Josef Möllers
Subject: Re: [Wget-dev] wget2 | Handle wide characters in download progress bar. (!407)
Date: Tue, 16 Oct 2018 13:09:18 +0000

Josef Möllers commented on a discussion on libwget/bar.c:

>               // xxx.xxKB/s   _BAR_SPEED_SIZE         Download speed
>               // ===>         Remaining               Progress Meter
>  
> +             inspect_multibyte(slotp->filename, _BAR_FILENAME_SIZE, 
> &consumed, &pad);
>               wget_fprintf(stdout, "%-*.*s %*d%% [%s] %*s %*s%c/s",
> -                             _BAR_FILENAME_SIZE, _BAR_FILENAME_SIZE, 
> slotp->filename,
> +                             (int) (consumed+pad), (int) (consumed+pad), 
> slotp->filename,

No, the screen column width is indeed _BAR_FILENAME_SIZE, but wget_fprintf() is 
not aware of the screen column width, it will spit out characters according to 
the values put here. "inspect_multibyte()" determines how many characters from 
the filename will fill _BAR_FILENAME_SIZE columns, also determining whether 
there are not enough, so padding will be required.

-- 
Reply to this email directly or view it on GitLab: 
https://gitlab.com/gnuwget/wget2/merge_requests/407#note_109181662
You're receiving this email because of your account on gitlab.com.


reply via email to

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