diff options
author | KWSys Upstream <kwrobot@kitware.com> | 2018-09-14 17:13:00 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-09-14 17:25:53 (GMT) |
commit | b13c8526b1f617f5dd146f42c6e1d48040cb527d (patch) | |
tree | 0da32baf9a87c0a2791aa5410ac44c8cc938f74c | |
parent | 4d76239a5107c0eb63486d948ae862784cfc6f9b (diff) | |
download | CMake-b13c8526b1f617f5dd146f42c6e1d48040cb527d.zip CMake-b13c8526b1f617f5dd146f42c6e1d48040cb527d.tar.gz CMake-b13c8526b1f617f5dd146f42c6e1d48040cb527d.tar.bz2 |
KWSys 2018-09-14 (1809bedd)
Code extracted from:
https://gitlab.kitware.com/utils/kwsys.git
at commit 1809bedde0491d078ad42200bf2834c345e65398 (master).
Upstream Shortlog
-----------------
Ben Boeckel (2):
b5b294c1 SystemTools::Split: fix copy-pasta comments
ab0d44c9 SystemTools::Split: use str.find_first_of(char)
Roger Leigh (1):
bdd39241 Process: On Windows do not open stdin file with write permission
-rw-r--r-- | ProcessWin32.c | 4 | ||||
-rw-r--r-- | SystemTools.cxx | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/ProcessWin32.c b/ProcessWin32.c index 9fa0cb1..2a2e737 100644 --- a/ProcessWin32.c +++ b/ProcessWin32.c @@ -973,8 +973,8 @@ void kwsysProcess_Execute(kwsysProcess* cp) wchar_t* wstdin = kwsysEncoding_DupToWide(cp->PipeFileSTDIN); DWORD error; cp->PipeChildStd[0] = - CreateFileW(wstdin, GENERIC_READ | GENERIC_WRITE, - FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0); + CreateFileW(wstdin, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, + OPEN_EXISTING, 0, 0); error = GetLastError(); /* Check now in case free changes this. */ free(wstdin); if (cp->PipeChildStd[0] == INVALID_HANDLE_VALUE) { diff --git a/SystemTools.cxx b/SystemTools.cxx index 476fe08..0a4ad7a 100644 --- a/SystemTools.cxx +++ b/SystemTools.cxx @@ -3640,11 +3640,11 @@ bool SystemTools::Split(const std::string& str, while (lpos < data.length()) { std::string::size_type rpos = data.find_first_of(separator, lpos); if (rpos == std::string::npos) { - // Line ends at end of string without a newline. + // String ends at end of string without a separator. lines.push_back(data.substr(lpos)); return false; } else { - // Line ends in a "\n", remove the character. + // String ends in a separator, remove the character. lines.push_back(data.substr(lpos, rpos - lpos)); } lpos = rpos + 1; @@ -3658,7 +3658,7 @@ bool SystemTools::Split(const std::string& str, std::string data(str); std::string::size_type lpos = 0; while (lpos < data.length()) { - std::string::size_type rpos = data.find_first_of("\n", lpos); + std::string::size_type rpos = data.find_first_of('\n', lpos); if (rpos == std::string::npos) { // Line ends at end of string without a newline. lines.push_back(data.substr(lpos)); |