diff options
author | KWSys Upstream <kwrobot@kitware.com> | 2019-10-30 13:16:39 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-10-30 13:17:30 (GMT) |
commit | fe6725a1f7c055b920508e7179fbc21a38cd37d3 (patch) | |
tree | db8531018b4be5c81ddd525cbb7f6f77af2a88ed | |
parent | 3327c0402a1ce31615c7ad22c5ff5d5330fb75da (diff) | |
download | CMake-fe6725a1f7c055b920508e7179fbc21a38cd37d3.zip CMake-fe6725a1f7c055b920508e7179fbc21a38cd37d3.tar.gz CMake-fe6725a1f7c055b920508e7179fbc21a38cd37d3.tar.bz2 |
KWSys 2019-10-30 (43131a7c)
Code extracted from:
https://gitlab.kitware.com/utils/kwsys.git
at commit 43131a7c283dd6f198a2318a25e546a97ac356b3 (master).
Upstream Shortlog
-----------------
Brad King (1):
cdd52ce1 RegularExpression: Initialize RegularExpressionMatch arrays fully
Todd Martin (1):
569a1aed Encoding: Add ToWindowsExtendedPath support for wide string
-rw-r--r-- | Encoding.hxx.in | 2 | ||||
-rw-r--r-- | EncodingCXX.cxx | 14 | ||||
-rw-r--r-- | RegularExpression.hxx.in | 6 |
3 files changed, 17 insertions, 5 deletions
diff --git a/Encoding.hxx.in b/Encoding.hxx.in index b067521..75a2d4d 100644 --- a/Encoding.hxx.in +++ b/Encoding.hxx.in @@ -68,6 +68,8 @@ public: * absolute paths with Windows-style backslashes. **/ static std::wstring ToWindowsExtendedPath(std::string const&); + static std::wstring ToWindowsExtendedPath(const char* source); + static std::wstring ToWindowsExtendedPath(std::wstring const& wsource); # endif #endif // @KWSYS_NAMESPACE@_STL_HAS_WSTRING diff --git a/EncodingCXX.cxx b/EncodingCXX.cxx index 4593c92..5cad934 100644 --- a/EncodingCXX.cxx +++ b/EncodingCXX.cxx @@ -221,8 +221,18 @@ std::string Encoding::ToNarrow(const wchar_t* wcstr) // Convert local paths to UNC style paths std::wstring Encoding::ToWindowsExtendedPath(std::string const& source) { - std::wstring wsource = Encoding::ToWide(source); + return ToWindowsExtendedPath(ToWide(source)); +} +// Convert local paths to UNC style paths +std::wstring Encoding::ToWindowsExtendedPath(const char* source) +{ + return ToWindowsExtendedPath(ToWide(source)); +} + +// Convert local paths to UNC style paths +std::wstring Encoding::ToWindowsExtendedPath(std::wstring const& wsource) +{ // Resolve any relative paths DWORD wfull_len; @@ -269,7 +279,7 @@ std::wstring Encoding::ToWindowsExtendedPath(std::string const& source) // If this case has been reached, then the path is invalid. Leave it // unchanged - return Encoding::ToWide(source); + return wsource; } # endif diff --git a/RegularExpression.hxx.in b/RegularExpression.hxx.in index df7eb45..0c2366b 100644 --- a/RegularExpression.hxx.in +++ b/RegularExpression.hxx.in @@ -70,10 +70,10 @@ private: * \brief Creates an invalid match object */ inline RegularExpressionMatch::RegularExpressionMatch() + : startp{} + , endp{} + , searchstring{} { - startp[0] = nullptr; - endp[0] = nullptr; - searchstring = nullptr; } /** |