cURL

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[curl:bugs] #1341 eol-less file created but not written to

From: Louis Bettens <fistonbettens_at_users.sf.net>
Date: Wed, 12 Mar 2014 21:15:09 +0000

---
** [bugs:#1341] eol-less file created but not written to**
**Status:** open
**Labels:** eof eol end-of-file end-of-line hackage rare 
**Created:** Wed Mar 12, 2014 09:15 PM UTC by Louis Bettens
**Last Updated:** Wed Mar 12, 2014 09:15 PM UTC
**Owner:** nobody
When attempting to download a file with no end-of-line character at all (one line without termination), curl seems to miss the entire contents. We end up with an empty file. Such a file is probably rare, but exists.

$ curl http://hackage.haskell.org/distros/


doesn't print anything. The expected result is the contents of the file.

That file is weird, sure, but allowed by the RFC on comma-separated values files (4180, ยง 2.2).

I don't think fwrite causes the bug, the following gives the expected result :

~~~~~~
#include <stdio.h>
#include <stdlib.h>

int main()
{
  const char* str = "Debian, Fedora, FreeBSD, NixOS";
  fwrite (str, 30, 1, stdout);
  return EXIT_SUCCESS;
}
~~~~~~

Files with no line termination at the end but multiple lines aren't affected.

I haven't tried any protocol other than HTTP.

I'm using Debian, here are details :

$ curl -V
curl 7.35.0 (i486-pc-linux-gnu) libcurl/7.35.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 libssh2/1.4.3 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp 
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP
---
Sent from sourceforge.net because curl-tracker@cool.haxx.se is subscribed to https://sourceforge.net/p/curl/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/curl/admin/bugs/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.
Received on 2014-03-12

These mail archives are generated by hypermail.

donate! Page updated December 29, 2013.
web site info

File upload with ASP.NET