diff options
author | Nico Weber <nicolasweber@gmx.de> | 2014-05-30 01:14:48 (GMT) |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2014-05-30 01:14:51 (GMT) |
commit | 8d84ba41dee869935243da46e4bf61fc84117676 (patch) | |
tree | cd6cef6fb200854570fe153cb431839c0bf48b16 /src | |
parent | 6915955e370e74d987bb95946a1cf71d9aafb61b (diff) | |
download | Ninja-8d84ba41dee869935243da46e4bf61fc84117676.zip Ninja-8d84ba41dee869935243da46e4bf61fc84117676.tar.gz Ninja-8d84ba41dee869935243da46e4bf61fc84117676.tar.bz2 |
Allow + in filenames without escaping
Due to #690, file.c++ used to be escaped. + seems as safe as -, so allow
it to not be escaped, to keep compile command lines with a fairly common
extension slightly cleaner.
Diffstat (limited to 'src')
-rw-r--r-- | src/util.cc | 1 | ||||
-rw-r--r-- | src/util_test.cc | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/util.cc b/src/util.cc index 24d231f..484b0c1 100644 --- a/src/util.cc +++ b/src/util.cc @@ -183,6 +183,7 @@ static inline bool IsKnownShellSafeCharacter(char ch) { switch (ch) { case '_': + case '+': case '-': case '.': case '/': diff --git a/src/util_test.cc b/src/util_test.cc index f827e5a..b58d15e 100644 --- a/src/util_test.cc +++ b/src/util_test.cc @@ -148,7 +148,7 @@ TEST(PathEscaping, TortureTest) { } TEST(PathEscaping, SensiblePathsAreNotNeedlesslyEscaped) { - const char* path = "some/sensible/path/without/crazy/characters.cc"; + const char* path = "some/sensible/path/without/crazy/characters.c++"; string result; GetWin32EscapedString(path, &result); @@ -160,7 +160,7 @@ TEST(PathEscaping, SensiblePathsAreNotNeedlesslyEscaped) { } TEST(PathEscaping, SensibleWin32PathsAreNotNeedlesslyEscaped) { - const char* path = "some\\sensible\\path\\without\\crazy\\characters.cc"; + const char* path = "some\\sensible\\path\\without\\crazy\\characters.c++"; string result; GetWin32EscapedString(path, &result); |