From 88002b322dc800fd494db4bcb2833fee665ef6a1 Mon Sep 17 00:00:00 2001 From: Zack Date: Fri, 31 May 2024 11:44:56 -0700 Subject: [PATCH] fix: receiver needs to exit without initializing files if no files being transfered --- src/croc/croc.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/croc/croc.go b/src/croc/croc.go index f3d7e78..95eb4f3 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -1064,7 +1064,7 @@ func (c *Client) Receive() (err error) { err = c.transfer() if err == nil { if c.numberOfTransferredFiles+len(c.EmptyFoldersToTransfer) == 0 { - fmt.Fprintf(os.Stderr, "\rNo files transferred.") + fmt.Fprintf(os.Stderr, "\rNo files transferred.\n") } } return @@ -1638,6 +1638,7 @@ func (c *Client) recipientGetFileReady(finished bool) (err error) { } c.SuccessfulTransfer = true c.FilesHasFinished[c.FilesToTransferCurrentNum] = struct{}{} + return } err = c.recipientInitializeFile()