From 9bc3565ccb99690add28ba6a032fb9d09d16b521 Mon Sep 17 00:00:00 2001 From: ahcorde Date: Tue, 1 Sep 2020 18:28:59 +0200 Subject: [PATCH 1/2] Fixed save worlds Signed-off-by: ahcorde --- src/SdfGenerator.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/SdfGenerator.cc b/src/SdfGenerator.cc index 2dd61dbfe1..5dac42904d 100644 --- a/src/SdfGenerator.cc +++ b/src/SdfGenerator.cc @@ -216,12 +216,16 @@ namespace sdf_generator // absolute path, so there is no need to update it. if (uriStr.find("file://") == std::string::npos) { - if (uriStr[0] != '/') + if(uriStr.find("http://") == std::string::npos && + uriStr.find("https://") == std::string::npos) { - // relative uri - uriStr = common::joinPaths(_prefixPath, uriStr); + if (uriStr[0] != '/') + { + // relative uri + uriStr = common::joinPaths(_prefixPath, uriStr); + } + uriStr = std::string("file://") + uriStr; } - uriStr = std::string("file://") + uriStr; uriElem->Set(uriStr); } } From 4fd581148cb6294698a65eb12acbb32880b29de5 Mon Sep 17 00:00:00 2001 From: ahcorde Date: Tue, 1 Sep 2020 18:36:03 +0200 Subject: [PATCH 2/2] make linters happy Signed-off-by: ahcorde --- src/SdfGenerator.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SdfGenerator.cc b/src/SdfGenerator.cc index 5dac42904d..1c48bed8a0 100644 --- a/src/SdfGenerator.cc +++ b/src/SdfGenerator.cc @@ -216,7 +216,7 @@ namespace sdf_generator // absolute path, so there is no need to update it. if (uriStr.find("file://") == std::string::npos) { - if(uriStr.find("http://") == std::string::npos && + if (uriStr.find("http://") == std::string::npos && uriStr.find("https://") == std::string::npos) { if (uriStr[0] != '/')