[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] Support non-ASCII URLs
From: |
Tim Ruehsen |
Subject: |
Re: [Bug-wget] Support non-ASCII URLs |
Date: |
Thu, 17 Dec 2015 17:50:47 +0100 |
User-agent: |
KMail/4.14.10 (Linux/4.3.0-1-amd64; KDE/4.14.14; x86_64; ; ) |
On Wednesday 16 December 2015 12:25:10 Eli Zaretskii wrote:
> > From: Giuseppe Scrivano <address@hidden>
> > Cc: address@hidden, address@hidden
> > Date: Wed, 16 Dec 2015 10:53:51 +0100
> >
> > > + for (;;)
> > > + {
> > > + if (iconv (cd, &fname, &inlen, &s, &outlen) != (size_t)(-1))
> > > + {
> > > + /* Flush the last bytes. */
> > > + iconv (cd, NULL, NULL, &s, &outlen);
> >
> > should not the return code be checked here?
>
> We should probably simply copy what iri.c does in a similar function,
> yes.
>
> > > + else if (errno == E2BIG) /* Output buffer full */
> > > + {
> > > + char *new;
> > > +
> > > + done = len;
> > > + outlen = done + inlen * 2;
> > > + new = xmalloc (outlen + 1);
> > > + memcpy (new, converted_fname, done);
> > > + xfree (converted_fname);
> >
> > What would be the extra cost in terms of copied bytes if we just replace
> > the three lines above with xrealloc?
>
> I don't know, probably nothing. This is simply copied (with trivial
> changes) from do_conversion in iri.c, so if we want to make that
> change, we should do it there as well.
Here is the patch for do_conversion in iri.c.
@Giuseppe: If it's ok for you, I'll push it.
@Eli: If my change is ok for Giuseppe, please apply the changes from iri.c to
your patch. If possible, make a local commit and create the attachment/patch
with 'git format -1' (or -2 for the latest two commits). That makes it easier
for us to apply the patch since author (you) and commit message are copied as
well.
Regards, Tim
0001-Cleanup-code.patch
Description: Text Data
- Re: [Bug-wget] URL encoding issues (Was: GNU wget 1.17.1 released), (continued)
- Re: [Bug-wget] URL encoding issues (Was: GNU wget 1.17.1 released), Andries E. Brouwer, 2015/12/15
- Re: [Bug-wget] URL encoding issues (Was: GNU wget 1.17.1 released), Tim Ruehsen, 2015/12/15
- Re: [Bug-wget] Support non-ASCII URLs (Was: GNU wget 1.17.1 released), Eli Zaretskii, 2015/12/15
- Re: [Bug-wget] Support non-ASCII URLs, Eli Zaretskii, 2015/12/15
- Re: [Bug-wget] Support non-ASCII URLs, Giuseppe Scrivano, 2015/12/16
- Re: [Bug-wget] Support non-ASCII URLs, Eli Zaretskii, 2015/12/16
- Re: [Bug-wget] Support non-ASCII URLs,
Tim Ruehsen <=
- Re: [Bug-wget] Support non-ASCII URLs, Giuseppe Scrivano, 2015/12/17
- Re: [Bug-wget] Support non-ASCII URLs, Eli Zaretskii, 2015/12/17
- Re: [Bug-wget] Support non-ASCII URLs, Tim Rühsen, 2015/12/17
- Re: [Bug-wget] Support non-ASCII URLs, Eli Zaretskii, 2015/12/17
- Re: [Bug-wget] Support non-ASCII URLs, Giuseppe Scrivano, 2015/12/18
- Re: [Bug-wget] Support non-ASCII URLs, Eli Zaretskii, 2015/12/18
- Re: [Bug-wget] Support non-ASCII URLs, Giuseppe Scrivano, 2015/12/18
- Re: [Bug-wget] Support non-ASCII URLs, Tim Rühsen, 2015/12/18
- Re: [Bug-wget] Support non-ASCII URLs, Eli Zaretskii, 2015/12/19
- Re: [Bug-wget] Support non-ASCII URLs, Eli Zaretskii, 2015/12/19