rscp

git clone https://orangeshoelaces.net/git/rscp.git

dff03f74a1a61b3e6a1398a8f7f019758bdffa9f

Author: Vasily Kolobkov on 07/02/2017

Committer: Vasily Kolobkov on 07/02/2017

Keep original file name in error messages

Stats

rscp.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/rscp.go b/rscp.go
index 0908c66..6960de7 100644
--- a/rscp.go
+++ b/rscp.go
@@ -343,7 +343,6 @@ func send(name string) error {
 	if err != nil {
 		return teeError(err)
 	}
-	name = st.Name()
 
 	if mode := st.Mode(); mode.IsDir() {
 		if *iamRecursive {
@@ -360,8 +359,9 @@ func send(name string) error {
 		}
 	}
 
+	base := st.Name()
 	if _, err := fmt.Fprintf(out, "C%04o %d %s\n",
-		toPosixPerm(st.Mode()), st.Size(), name); err != nil {
+		toPosixPerm(st.Mode()), st.Size(), base); err != nil {
 
 		return FatalError(err.Error())
 	}