From fe9d9f15846717462576383a7a68f2900e132a1c Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Tue, 9 Sep 2014 07:05:10 +0200 Subject: [PATCH] If there is no path component at all, do append it to the destination. --- adb-sync | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/adb-sync b/adb-sync index ff858b1..806b257 100755 --- a/adb-sync +++ b/adb-sync @@ -589,12 +589,14 @@ def FixPath(src, dst): # rsync-like path munging to make remote specifications shorter. pos = src.rfind(b'/') if pos >= 0: - if pos == len(src)-1: + if src.endswith(b'/'): # Final slash: copy to the destination "as is". src = src[:-1] else: # No final slash: destination name == source name. dst += src[pos:] + else: + dst += b'/' + src return (src, dst)