[clang-tools-extra] r324475 - [clangd] Do not precent-encode numbers in URI.
Eric Liu via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 7 04:12:06 PST 2018
Author: ioeric
Date: Wed Feb 7 04:12:06 2018
New Revision: 324475
URL: http://llvm.org/viewvc/llvm-project?rev=324475&view=rev
Log:
[clangd] Do not precent-encode numbers in URI.
Reviewers: ilya-biryukov
Subscribers: klimek, jkorous-apple, cfe-commits, sammccall
Differential Revision: https://reviews.llvm.org/D43009
Modified:
clang-tools-extra/trunk/clangd/URI.cpp
clang-tools-extra/trunk/unittests/clangd/URITests.cpp
Modified: clang-tools-extra/trunk/clangd/URI.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/URI.cpp?rev=324475&r1=324474&r2=324475&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/URI.cpp (original)
+++ clang-tools-extra/trunk/clangd/URI.cpp Wed Feb 7 04:12:06 2018
@@ -79,7 +79,8 @@ findSchemeByName(llvm::StringRef Scheme)
bool shouldEscape(unsigned char C) {
// Unreserved characters.
- if ((C >= 'a' && C <= 'z') || (C >= 'A' && C <= 'Z'))
+ if ((C >= 'a' && C <= 'z') || (C >= 'A' && C <= 'Z') ||
+ (C >= '0' && C <= '9'))
return false;
switch (C) {
case '-':
Modified: clang-tools-extra/trunk/unittests/clangd/URITests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clangd/URITests.cpp?rev=324475&r1=324474&r2=324475&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clangd/URITests.cpp (original)
+++ clang-tools-extra/trunk/unittests/clangd/URITests.cpp Wed Feb 7 04:12:06 2018
@@ -72,6 +72,7 @@ URI parseOrDie(llvm::StringRef Uri) {
TEST(PercentEncodingTest, Encode) {
EXPECT_EQ(URI("x", /*Authority=*/"", "a/b/c").toString(), "x:a/b/c");
EXPECT_EQ(URI("x", /*Authority=*/"", "a!b;c~").toString(), "x:a%21b%3bc~");
+ EXPECT_EQ(URI("x", /*Authority=*/"", "a123b").toString(), "x:a123b");
}
TEST(PercentEncodingTest, Decode) {
More information about the cfe-commits
mailing list