bug-wget
[Top][All Lists]
Advanced

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

Re: [Bug-wget] Wget 1.11.4 and FTP Server from Windows Server 2008 R2


From: Tim Ruehsen
Subject: Re: [Bug-wget] Wget 1.11.4 and FTP Server from Windows Server 2008 R2
Date: Fri, 5 Oct 2012 11:29:52 +0200
User-agent: KMail/1.13.7 (Linux/3.2.0-3-amd64; KDE/4.8.4; x86_64; ; )

I am not willing to look too deeply into this bloated code in url.c.

But from a peephole point of view, what do you think of a codechange like 
this:

  max_length = get_max_length (fnres.base, fnres.tail, _PC_NAME_MAX);

  if (max_length > CHOMP_BUFFER)
    max_length -= CHOMP_BUFFER;
  else
    max_length = 0;

  if (max_length > 0 && strlen (temp_fnres.base) > max_length)
    {
      logprintf (LOG_NOTQUIET, "The name is too long, %lu chars total.\n",
          (unsigned long) strlen (temp_fnres.base));
      logprintf (LOG_NOTQUIET, "Trying to shorten...\n");

      /* Shorten the file name. */
      temp_fnres.base[max_length] = '\0';
      temp_fnres.tail = max_length;

      logprintf (LOG_NOTQUIET, "New name is %s.\n", temp_fnres.base);
    }

Regards

     Tim Rühsen



reply via email to

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