cURL / Mailing Lists / curl-library / Single Mail


Re: Error message buffer as ^M on the end of it (carraige-return).

From: Daniel Stenberg <>
Date: Sun, 9 Dec 2001 17:58:29 +0100 (MET)

On Sat, 8 Dec 2001, Ben Greear wrote:

> This causes the printout to look incorrect on Linux (UNIX) machines.
> For instance, I see this message if I look at the log file in emacs or
> vi:
> Failed FTP upload: gnuserver.upload: Permission denied on server.
> (Overwrite)^M
> but if I view it in a terminal screen with more, the whole line
> dissappears (and 'erases' anything previous to that error message too).
> I can write a post-filtering method to strip out the ^M's, but it'd be
> nicer if they were never there :)

Checking the source code, there's an obvious confusion in how Curl_failf() is
used. It sometimes is used *with* newlines and sometimes *without*. This
should be corrected.

In this particular case you mention here, the end of the error message is
read straight from the FTP server's response and that's how the CR ended up
in the buffer.

I think we should probably fix Curl_failf() to always strip off both CRs and
LFs from the buffer to avoid this problem.

    Daniel Stenberg -- curl groks URLs --
Received on 2001-12-09