bug-wget
[Top][All Lists]
Advanced

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

Re: [Bug-wget] Support non-ASCII URLs


From: Eli Zaretskii
Subject: Re: [Bug-wget] Support non-ASCII URLs
Date: Wed, 16 Dec 2015 12:25:10 +0200

> 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.

Thanks.



reply via email to

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