From a5cbfbbcbbc8bc2dabc7ab166c09d116861f3cfd Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 18 Apr 2015 16:33:31 -0300 Subject: -fixed relative path saving to file, fixes #1694 --- core/io/resource_format_binary.cpp | 2 +- core/io/resource_format_xml.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'core') diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index f5ef402194..3d7d2f2367 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -390,7 +390,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) { if (path.find("://")==-1 && path.is_rel_path()) { // path is relative to file being loaded, so convert to a resource path - path=Globals::get_singleton()->localize_path(res_path.get_base_dir()+"/"+path); + path=Globals::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path)); } diff --git a/core/io/resource_format_xml.cpp b/core/io/resource_format_xml.cpp index e635dc52f9..50b1eba6e7 100644 --- a/core/io/resource_format_xml.cpp +++ b/core/io/resource_format_xml.cpp @@ -458,7 +458,7 @@ Error ResourceInteractiveLoaderXML::parse_property(Variant& r_v, String &r_name) path=path.replace("local://",local_path+"::"); else if (path.find("://")==-1 && path.is_rel_path()) { // path is relative to file being loaded, so convert to a resource path - path=Globals::get_singleton()->localize_path(local_path.get_base_dir()+"/"+path); + path=Globals::get_singleton()->localize_path(local_path.get_base_dir().plus_file(path)); } @@ -1423,7 +1423,7 @@ Error ResourceInteractiveLoaderXML::poll() { if (path.find("://")==-1 && path.is_rel_path()) { // path is relative to file being loaded, so convert to a resource path - path=Globals::get_singleton()->localize_path(local_path.get_base_dir()+"/"+path); + path=Globals::get_singleton()->localize_path(local_path.get_base_dir().plus_file(path)); } @@ -1601,7 +1601,7 @@ void ResourceInteractiveLoaderXML::get_dependencies(FileAccess *f,List * if (path.find("://")==-1 && path.is_rel_path()) { // path is relative to file being loaded, so convert to a resource path - path=Globals::get_singleton()->localize_path(local_path.get_base_dir()+"/"+path); + path=Globals::get_singleton()->localize_path(local_path.get_base_dir().plus_file(path)); } if (path.ends_with("*")) { -- cgit v1.2.3