diff options
author | Brad King <brad.king@kitware.com> | 2019-10-31 12:54:35 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-10-31 12:54:45 (GMT) |
commit | 9a72065fa9de6f9bdf25bbf46137c7c6b4e8196e (patch) | |
tree | 3a973dbe889784fadb6a8af402334970718ea189 | |
parent | fde927d76b9d5fcb6721140cf14b6a56156d5c4c (diff) | |
parent | 5ddcaae77c531fc2e696204799505fbccb18b10d (diff) | |
download | CMake-9a72065fa9de6f9bdf25bbf46137c7c6b4e8196e.zip CMake-9a72065fa9de6f9bdf25bbf46137c7c6b4e8196e.tar.gz CMake-9a72065fa9de6f9bdf25bbf46137c7c6b4e8196e.tar.bz2 |
Merge topic 'update-kwsys'
5ddcaae77c Merge branch 'upstream-KWSys' into update-kwsys
fe6725a1f7 KWSys 2019-10-30 (43131a7c)
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3963
-rw-r--r-- | Source/kwsys/Encoding.hxx.in | 2 | ||||
-rw-r--r-- | Source/kwsys/EncodingCXX.cxx | 14 | ||||
-rw-r--r-- | Source/kwsys/RegularExpression.hxx.in | 6 |
3 files changed, 17 insertions, 5 deletions
diff --git a/Source/kwsys/Encoding.hxx.in b/Source/kwsys/Encoding.hxx.in index b067521..75a2d4d 100644 --- a/Source/kwsys/Encoding.hxx.in +++ b/Source/kwsys/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/Source/kwsys/EncodingCXX.cxx b/Source/kwsys/EncodingCXX.cxx index 4593c92..5cad934 100644 --- a/Source/kwsys/EncodingCXX.cxx +++ b/Source/kwsys/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/Source/kwsys/RegularExpression.hxx.in b/Source/kwsys/RegularExpression.hxx.in index df7eb45..0c2366b 100644 --- a/Source/kwsys/RegularExpression.hxx.in +++ b/Source/kwsys/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; } /** |