Skip to content

Commit

Permalink
Merge pull request #34348 from Catchawink/master
Browse files Browse the repository at this point in the history
Fixed issues with using a relative path in the export window.
  • Loading branch information
akien-mga authored Dec 17, 2019
2 parents 98e5406 + b2a1404 commit 7d34d1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/ustring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3792,7 +3792,8 @@ bool String::is_valid_float() const {

String String::path_to_file(const String &p_path) const {

String src = this->replace("\\", "/").get_base_dir();
// Don't get base dir for src, this is expected to be a dir already.
String src = this->replace("\\", "/");
String dst = p_path.replace("\\", "/").get_base_dir();
String rel = src.path_to(dst);
if (rel == dst) // failed
Expand Down
2 changes: 2 additions & 0 deletions editor/editor_file_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,8 @@ String EditorFileDialog::get_current_path() const {
}
void EditorFileDialog::set_current_dir(const String &p_dir) {

if (p_dir.is_rel_path())
dir_access->change_dir(OS::get_singleton()->get_resource_dir());
dir_access->change_dir(p_dir);
update_dir();
invalidate();
Expand Down

0 comments on commit 7d34d1a

Please sign in to comment.