bug-wget
[Top][All Lists]
Advanced

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

Re: [Bug-wget] bad filenames (again)


From: Tim Ruehsen
Subject: Re: [Bug-wget] bad filenames (again)
Date: Thu, 13 Aug 2015 17:54:57 +0200
User-agent: KMail/4.14.2 (Linux/4.1.0-1-amd64; KDE/4.14.2; x86_64; ; )

Hi Andries,

I just made up a test case, but can't apply your patch.

Please rebase to latest git master and generate your patch with
git format-patch and send it as attachment. Thanks.

Regards, Tim

On Wednesday 12 August 2015 19:36:52 Andries E. Brouwer wrote:
> On Wed, Aug 12, 2015 at 05:54:25PM +0200, Tim Ruehsen wrote:
> > OK. Let's set up a test where we define input and expected output.
> > If that works, I am fine.
> 
> OK. I mentioned a Hebrew example, but in order to avoid
> the additional difficulty of bidi text, let me find a
> Russian example instead.
> 
> % wget https://ru.wikipedia.org/wiki/%D0%A1%D0%B5%D1%80%D0%B4%D1%86%D0%B5
> Saving to: ‘Се\321%80д\321%86е’
> 
> % my_wget https://ru.wikipedia.org/wiki/%D0%A1%D0%B5%D1%80%D0%B4%D1%86%D0%B5
> Saving to: ‘Сердце’
> 
> (This is the Russian Wikipedia page for 'heart').
> 
> Andries
> 
> 
> ---
> 
> BTW - now that I tried this: the progress bar contains an ugly symbol.
> Looking at progress.c I see
> 
>       int padding = MAX_FILENAME_COLS - orig_filename_cols;
>       sprintf (p, "%s ", bp->f_download);
>       p += orig_filename_cols + 1;
>       for (;padding;padding--)
>         *p++ = ' ';
> 
> but orig_filename_cols was computed correctly, counting character
> positions, not bytes, and the
>       p += orig_filename_cols + 1;
> is a bug.
> The ugly symbol is because a multibyte character was truncated.
> 
> If I write
> 
>       sprintf (p, "%s ", bp->f_download);
>       p += strlen(bp->f_download) + 1;
>       while (p < bp->buffer + MAX_FILENAME_COLS)
>         *p++ = ' ';
> 
> instead, then the progress bar text looks right in this particular case.
> I have not yet read the surrounding code.




reply via email to

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