From ff73ce9ff3ff1fb13a434cbba12b0ae5eeacd90e Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 11 Feb 2016 21:00:08 +0100 Subject: [PATCH 1/2] Changed: Minor changes --HG-- branch : develop --- code/ryzom/client/src/seven_zip/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/ryzom/client/src/seven_zip/CMakeLists.txt b/code/ryzom/client/src/seven_zip/CMakeLists.txt index c4d61ae1d..625544edb 100644 --- a/code/ryzom/client/src/seven_zip/CMakeLists.txt +++ b/code/ryzom/client/src/seven_zip/CMakeLists.txt @@ -14,11 +14,11 @@ ADD_DEFINITIONS(-DUNICODE -D_UNICODE -D_7ZIP_PPMD_SUPPPORT) IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(ryzom_sevenzip ${CMAKE_CURRENT_SOURCE_DIR}/Precomp.h ${CMAKE_CURRENT_SOURCE_DIR}/Precomp.cpp) -ENDIF(WITH_PCH) +ENDIF() IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) INSTALL(TARGETS ryzom_sevenzip LIBRARY DESTINATION ${RYZOM_LIB_PREFIX} ARCHIVE DESTINATION ${RYZOM_LIB_PREFIX} COMPONENT libraries) -ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC) +ENDIF() IF(WITH_RYZOM_TOOLS) ADD_EXECUTABLE(7zDec ${CMAKE_CURRENT_SOURCE_DIR}/7zMain.cpp) @@ -28,4 +28,4 @@ IF(WITH_RYZOM_TOOLS) NL_ADD_RUNTIME_FLAGS(7zDec) INSTALL(TARGETS 7zDec RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) -ENDIF(WITH_RYZOM_TOOLS) +ENDIF() From 53a16257f14113e34bbcb7b400c795fd5cbb5d49 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 11 Feb 2016 21:00:54 +0100 Subject: [PATCH 2/2] Fixed: CPath::makePathAbsolute removing first / --HG-- branch : develop --- code/nel/src/misc/path.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/code/nel/src/misc/path.cpp b/code/nel/src/misc/path.cpp index aa66f0fd7..077bc18be 100644 --- a/code/nel/src/misc/path.cpp +++ b/code/nel/src/misc/path.cpp @@ -2578,13 +2578,13 @@ std::string CPath::makePathAbsolute( const std::string &relativePath, const std: { absolutePath = relativePath; } -#else - // Unix filesystem absolute path + else +#endif + // Unix filesystem absolute path (works also under Windows) if (relativePath[0] == '/') { absolutePath = relativePath; } -#endif else { // Add a slash to the directory if necessary. @@ -2610,14 +2610,15 @@ std::string CPath::makePathAbsolute( const std::string &relativePath, const std: // Now build the new absolute path absolutePath += relativePath; - absolutePath = standardizePath(absolutePath, true); } + absolutePath = standardizePath(absolutePath, true); + if (simplify) { // split all components path to manage parent directories std::vector tokens; - explode(absolutePath, std::string("/"), tokens, true); + explode(absolutePath, std::string("/"), tokens, false); std::vector directoryParts; @@ -2649,7 +2650,10 @@ std::string CPath::makePathAbsolute( const std::string &relativePath, const std: // rebuild the whole absolute path for(uint i = 1, len = directoryParts.size(); i < len; ++i) - absolutePath += "/" + directoryParts[i]; + { + if (!directoryParts[i].empty()) + absolutePath += "/" + directoryParts[i]; + } // add trailing slash absolutePath += "/";