]> granicus.if.org Git - curl/commitdiff
FTP: fix uploading ASCII with unknown size
authorDaniel Stenberg <daniel@haxx.se>
Sat, 26 Sep 2015 21:36:25 +0000 (23:36 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 26 Sep 2015 21:36:25 +0000 (23:36 +0200)
... don't try to increase the supposed file size on newlines if we don't
know what file size it is!

Patch-by: lzsiga
lib/transfer.c

index 718139b32623e6ea442bdc9570052569dd60c857..191523c8b26a3242c6f5d78974977b56b0a3f661 100644 (file)
@@ -923,7 +923,8 @@ static CURLcode readwrite_upload(struct SessionHandle *data,
             if(!data->set.crlf) {
               /* we're here only because FTP is in ASCII mode...
                  bump infilesize for the LF we just added */
-              data->state.infilesize++;
+              if(data->state.infilesize != -1)
+                data->state.infilesize++;
             }
           }
           else