From 32fc638ddf046d501abc2a58c91c3e934caf303a Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Sat, 26 Sep 2015 23:36:25 +0200
Subject: [PATCH] FTP: fix uploading ASCII with unknown size

... 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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/transfer.c b/lib/transfer.c
index 718139b326..191523c8b2 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -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
-- 
GitLab