Re: ftpget is adding cr nl to the end of the lines

From: <Lars.Slettjord@dont-contact.us>
Date: Wed, 24 Sep 1997 13:02:02 +0200

I got basically the same hint from 3 of you, and I found the cause of my
problems.

In the src/ftp.c file there is a ftpTransferMode function which uses the
table in include/mime_table.h to switch between ASCII and Binary mode for
the FTP transfer based on the MIME type of the file.

For testing purposes I have modified the function like this:

        static const char *
        ftpTransferMode(const char *urlpath)
        {
            const char *const ftpASCII = "A";
            const char *const ftpBinary = "I";
            /*
             * char *ext = NULL;
             * const ext_table_entry *mime = NULL;
             * int len;
             * len = strlen(urlpath);
             * if (*(urlpath + len - 1) == '/')
             * return ftpASCII;
             * if ((ext = strrchr(urlpath, '.')) == NULL)
             * return ftpBinary;
             * if ((mime = mime_ext_to_type(++ext)) == NULL)
             * return ftpBinary;
             * if (!strcmp(mime->mime_encoding, "7bit"))
             * return ftpASCII;
             */
            return ftpBinary;
        }

And it will probably solve my specific problem (I'll know tomorrow when I
have restarted my cache).

But does this break anything else? There is probably a reason why it is
done like this in the first place, even though it causes certain files to
be modified during the transfer.

-- 
| Lars Slettjord             | EMAIL: larss@cc.uit.no
| University Computer Centre | URL  : http://www.cc.uit.no/~larss/
| University of Tromsoe      | PHONE: +47 77644115
| N-9037 Tromsoe             | FAX  : +47 77644100
Received on Wed Sep 24 1997 - 05:38:32 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:37:09 MST