diff options
author | Nico Weber <nicolasweber@gmx.de> | 2017-09-06 19:01:47 (GMT) |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2017-09-06 19:01:47 (GMT) |
commit | f69c785dd6cbc847e8308439d227ffa913f7c903 (patch) | |
tree | db2ff9c5cd3665a7c510c0f2f7670ffcc2e334b8 | |
parent | 0c671527322d15016bb9ff5c3cf436f68e6ddbde (diff) | |
parent | 7738c19dc42f63bedb5cb728d6ebde71b8fdaaf4 (diff) | |
download | Ninja-f69c785dd6cbc847e8308439d227ffa913f7c903.zip Ninja-f69c785dd6cbc847e8308439d227ffa913f7c903.tar.gz Ninja-f69c785dd6cbc847e8308439d227ffa913f7c903.tar.bz2 |
v1.8.1v1.8.1
-rw-r--r-- | doc/manual.asciidoc | 2 | ||||
-rw-r--r-- | src/includes_normalize_test.cc | 53 | ||||
-rw-r--r-- | src/version.cc | 2 |
3 files changed, 27 insertions, 30 deletions
diff --git a/doc/manual.asciidoc b/doc/manual.asciidoc index 2410083..d54e097 100644 --- a/doc/manual.asciidoc +++ b/doc/manual.asciidoc @@ -1,6 +1,6 @@ The Ninja build system ====================== -v1.8.0, Sep 2017 +v1.8.1, Sep 2017 Introduction diff --git a/src/includes_normalize_test.cc b/src/includes_normalize_test.cc index 0bb14ec..eac36fd 100644 --- a/src/includes_normalize_test.cc +++ b/src/includes_normalize_test.cc @@ -108,36 +108,33 @@ TEST(IncludesNormalize, LongInvalidPath) { normalizer.Normalize(kLongInputString, &result, &err)); EXPECT_EQ("path too long", err); - const char kExactlyMaxPath[] = - "012345678\\" - "012345678\\" - "012345678\\" - "012345678\\" - "012345678\\" - "012345678\\" - "012345678\\" - "012345678\\" - "012345678\\" - "012345678\\" - "012345678\\" - "012345678\\" - "012345678\\" - "012345678\\" - "012345678\\" - "012345678\\" - "012345678\\" - "012345678\\" - "012345678\\" - "012345678\\" - "012345678\\" - "012345678\\" - "012345678\\" - "012345678\\" - "012345678\\" - "0123456789"; + + // Construct max size path having cwd prefix. + // kExactlyMaxPath = "$cwd\\a\\aaaa...aaaa\0"; + char kExactlyMaxPath[_MAX_PATH + 1]; + ASSERT_NE(_getcwd(kExactlyMaxPath, sizeof kExactlyMaxPath), NULL); + + int cwd_len = strlen(kExactlyMaxPath); + ASSERT_LE(cwd_len + 3 + 1, _MAX_PATH) + kExactlyMaxPath[cwd_len] = '\\'; + kExactlyMaxPath[cwd_len + 1] = 'a'; + kExactlyMaxPath[cwd_len + 2] = '\\'; + + kExactlyMaxPath[cwd_len + 3] = 'a'; + + for (int i = cwd_len + 4; i < _MAX_PATH; ++i) { + if (i > cwd_len + 4 && i < _MAX_PATH - 1 && i % 10 == 0) + kExactlyMaxPath[i] = '\\'; + else + kExactlyMaxPath[i] = 'a'; + } + + kExactlyMaxPath[_MAX_PATH] = '\0'; + EXPECT_EQ(strlen(kExactlyMaxPath), _MAX_PATH); + string forward_slashes(kExactlyMaxPath); replace(forward_slashes.begin(), forward_slashes.end(), '\\', '/'); // Make sure a path that's exactly _MAX_PATH long is canonicalized. - EXPECT_EQ(forward_slashes, + EXPECT_EQ(forward_slashes.substr(cwd_len + 1), NormalizeAndCheckNoError(kExactlyMaxPath)); } diff --git a/src/version.cc b/src/version.cc index ad2d09f..e2a9f49 100644 --- a/src/version.cc +++ b/src/version.cc @@ -18,7 +18,7 @@ #include "util.h" -const char* kNinjaVersion = "1.8.0"; +const char* kNinjaVersion = "1.8.1"; void ParseVersion(const string& version, int* major, int* minor) { size_t end = version.find('.'); |