Repository: fsspec/filesystem_spec

Issue:
Bug in recursive file copy into a destination directory
@ianthomas23 

I have found a bug in fsspec `.get('', 'dest/', recursive=True)`

I've pinned the issue down to `fsspec.utils.other_paths`. 

```python
In [1]: from fsspec.utils import other_paths

In [2]: out = other_paths(['a','b/','b/c'], 'dest/', is_dir=True, exists=False)

In [3]: out
Out[3]: ['desta', 'destb/', 'destb/c']
```

I'm trying to put the first list of paths inside the directory `dest/`. I have not found a combination of inputs (with and without `/` that produces my desired output

```
['dest/a', 'dest/b/', 'dest/b/c']
```

Discussion:

Patch:
diff --git a/fsspec/utils.py b/fsspec/utils.py
index e402931..01c4495 100644
--- a/fsspec/utils.py
+++ b/fsspec/utils.py
@@ -369,7 +369,10 @@ def other_paths(paths, path2, is_dir=None, exists=False):
         cp = common_prefix(paths)
         if exists:
             cp = cp.rsplit("/", 1)[0]
-        path2 = [p.replace(cp, path2, 1) for p in paths]
+        if not cp and all(not s.startswith("/") for s in paths):
+            path2 = ["/".join([path2, p]) for p in paths]
+        else:
+            path2 = [p.replace(cp, path2, 1) for p in paths]
     else:
         assert len(paths) == len(path2)
     return path2


Test patch:
diff --git a/fsspec/tests/test_utils.py b/fsspec/tests/test_utils.py
index 237f075..517d42b 100644
--- a/fsspec/tests/test_utils.py
+++ b/fsspec/tests/test_utils.py
@@ -321,6 +321,14 @@ def test_common_prefix(paths, out):
             True,
             ["/path2/more/path1", "/path2/diff/path2"],
         ),
+        (["a", "b/", "b/c"], "dest/", True, False, ["dest/a", "dest/b/", "dest/b/c"]),
+        (
+            ["/a", "/b/", "/b/c"],
+            "dest/",
+            True,
+            False,
+            ["dest/a", "dest/b/", "dest/b/c"],
+        ),
     ),
 )
 def test_other_paths(paths, other, is_dir, exists, expected):