mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-20 17:41:37 +00:00
Fixed usage of a partition pointing to a file instead of a folder
This commit is contained in:
parent
cafb547894
commit
7042680a0a
2 changed files with 8 additions and 2 deletions
|
|
@ -1,7 +1,8 @@
|
||||||
# Rojo Change Log
|
# Rojo Change Log
|
||||||
|
|
||||||
## Current Master
|
## Current Master
|
||||||
* *No changes*
|
* Fixed server when using a file as a partition
|
||||||
|
* Previously, trailing slashes were put on the end of a partition even if the read request was an empty string. This broke file reading on Windows when a partition pointed to a file instead of a directory!
|
||||||
|
|
||||||
## 0.2.3
|
## 0.2.3
|
||||||
* Plugin only release
|
* Plugin only release
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,12 @@ impl Vfs {
|
||||||
None => return None,
|
None => return None,
|
||||||
};
|
};
|
||||||
|
|
||||||
let full_path = {
|
// It's possible that the partition points to a file if `rest` is empty.
|
||||||
|
// Joining "" onto a path will put a trailing slash on, which causes
|
||||||
|
// file reads to fail.
|
||||||
|
let full_path = if rest.is_empty() {
|
||||||
|
partition.clone()
|
||||||
|
} else {
|
||||||
let joined = rest.join("/");
|
let joined = rest.join("/");
|
||||||
let relative = Path::new(&joined);
|
let relative = Path::new(&joined);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue