bug-wget
[Top][All Lists]
Advanced

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

Re: [Bug-wget] RESEND1: wget-1.20-win32


From: Tim Rühsen
Subject: Re: [Bug-wget] RESEND1: wget-1.20-win32
Date: Sat, 18 May 2019 11:48:20 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 18.05.19 11:33, Darshit Shah wrote:
> Thanks!
> 
> I'll try and see if I can reproduce this for a test.
> 
> * Jernej Simončič <jernej|address@hidden> [190513 09:27]:
>> On Sunday, May 12, 2019, 17:45:31, Darshit Shah wrote:
>>
>>> Could you please let us know which sites?
>>
>> It happens everywhere, as long as the filename is long enough to
>> require scrolling. I received a patch from Bykov Alexey
>> <address@hidden> that supposedly fixes this a few days ago, but
>> haven't had time to test it yet:
>>
>> diff --git a/src/progress.c b/src/progress.c
>> index 8e5709c7..6a69b4e2 100644
>> --- a/src/progress.c
>> +++ b/src/progress.c
>> @@ -845,8 +845,8 @@ static int count_cols (const char *mbs) { return (int) 
>> strlen(mbs); }
>>  static int
>>  cols_to_bytes (const char *mbs _GL_UNUSED, const int cols, int *ncols)
>>  {
>> -  *ncols = cols;
>> -  return cols;
>> +  *ncols = min(strlen(mbs),cols);
>> +  return *ncols;
>>  }
>>  #endif

mbs sounds like 'Multi Byte Sequence' aka UTF-8 (pretty sure UTF-16
isn't used in wget code). If this is true, using strlen() to figure out
the number of columns seems absolutely wrong. wcwidth() would be the
function to use... just my thoughts.

Regards, Tim

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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