summarylogtreecommitdiffstats
path: root/0004_URI_contains.patch
blob: ad08d963d65046b85bafc0ee59dfa33de2df4f80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
--- a/src/cbang/net/URI.cpp
+++ b/src/cbang/net/URI.cpp
@@ -85,7 +85,7 @@
   }
 
 
-  bool contains(const char *s, char c) {return c && strchr(s, c);}
+  bool my_contains(const char *s, char c) {return c && strchr(s, c);}
 }
 
 
@@ -347,7 +347,7 @@
   string result;
 
   for (auto c: s)
-    if (contains(unescaped, c)) result.append(1, c);
+    if (my_contains(unescaped, c)) result.append(1, c);
     else result.append(String::printf("%%%02x", (uint8_t)c));
 
   return result;
@@ -396,7 +396,7 @@
   string seg;
 
   while (true)
-    if (contains(PATH_SEGMENT_CHARS, *s)) seg.append(1, *s++);
+    if (my_contains(PATH_SEGMENT_CHARS, *s)) seg.append(1, *s++);
     else if (*s == '%') seg.append(1, parseEscape(s));
     else break;
 
@@ -408,7 +408,7 @@
   if (!isalpha(*s)) THROW("Expected alpha at start of scheme");
 
   while (true)
-    if (contains(SCHEME_CHARS, *s)) scheme.append(1, *s++);
+    if (my_contains(SCHEME_CHARS, *s)) scheme.append(1, *s++);
     else break;
 
   match(s, ':');
@@ -443,7 +443,7 @@
   string result;
 
   while (true)
-    if (contains(USER_PASS_CHARS, *s)) result.append(1, *s++);
+    if (my_contains(USER_PASS_CHARS, *s)) result.append(1, *s++);
     else if (*s == '%') result.append(1, parseEscape(s));
     else break;
 
@@ -459,7 +459,7 @@
 
 void URI::parseHost(const char *&s) {
   while (true)
-    if (contains(HOST_CHARS, *s)) host.append(1, *s++);
+    if (my_contains(HOST_CHARS, *s)) host.append(1, *s++);
     else break;
 
   if (host.empty()) THROW("Expected host character");
@@ -494,7 +494,7 @@
   string result;
 
   while (true)
-    if (contains(NAME_CHARS, *s)) result.append(1, *s++);
+    if (my_contains(NAME_CHARS, *s)) result.append(1, *s++);
     else if (*s == '%') result.append(1, parseEscape(s));
     else break;
 
@@ -508,7 +508,7 @@
   string result;
 
   while (true)
-    if (contains(VALUE_CHARS, *s)) result.append(1, *s++);
+    if (my_contains(VALUE_CHARS, *s)) result.append(1, *s++);
     else if (*s == '%') result.append(1, parseEscape(s));
     else break;