# remote: Fix missing path escaping in SFTP upload \(\#62239\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/daec37bdc54d3985ff2a8175fd05b73d0444d569)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: daec37bdc54d3985ff2a8175fd05b73d0444d569

Requested commit: daec37bdc54d3985ff2a8175fd05b73d0444d569

Commit: daec37bdc54d3985ff2a8175fd05b73d0444d569

Tree: 9072c9707739e2cb18186af7fd9e31360b63dce6

Author: Tom

Committer: GitHub

## Message

```
remote: Fix missing path escaping in SFTP upload (#62239)

# Objective

- Fixes #62238
- Properly escapes paths in the sftp PUT line

## Solution

- 10-line wrapper function that escapes paths as sftp expects. Namely:
paths in quotes with `\\` and `"` escaped.

## Testing

- Did you test these changes? If so, how? `cargo check`
- Are there any parts that need more testing? Up to you, this is a
simple change and I dont think sftp with default install paths ever
worked on MacOS
- How can other people (reviewers) test your changes? Is there anything
specific they need to know? Just connect to a remote on OSX and see if
the logs had an sftp upload failure in there
- If relevant, what platforms did you test these changes on, and are
there any important ones you can't test?

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

---

Release Notes:

- Fix remote uploads over sftp where the paths contain spaces

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
```

## Parents

- [c7537bdf463a998e7ec636adff33b198891e69ed](https://git.cafe/gitcafe/zed/commit/c7537bdf463a998e7ec636adff33b198891e69ed?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/daec37bdc54d3985ff2a8175fd05b73d0444d569?format=markdown)
