|
1 | | -/* auto-generated on 2025-03-30 13:24:42 -0400. Do not edit! */ |
| 1 | +/* auto-generated on 2025-04-24 20:04:09 -0400. Do not edit! */ |
2 | 2 | /* begin file src/ada.cpp */ |
3 | 3 | #include "ada.h" |
4 | 4 | /* begin file src/checkers.cpp */ |
@@ -11636,15 +11636,20 @@ ada_really_inline void parse_prepared_path(std::string_view input, |
11636 | 11636 | // Note: input cannot be empty, it must at least contain one character ('.') |
11637 | 11637 | // Note: we know that '\' is not present. |
11638 | 11638 | if (input[0] != '.') { |
11639 | | - size_t slashdot = input.find("/."); |
11640 | | - if (slashdot == std::string_view::npos) { // common case |
11641 | | - trivial_path = true; |
11642 | | - } else { // uncommon |
11643 | | - // only three cases matter: /./, /.. or a final / |
11644 | | - trivial_path = |
11645 | | - !(slashdot + 2 == input.size() || input[slashdot + 2] == '.' || |
11646 | | - input[slashdot + 2] == '/'); |
| 11639 | + size_t slashdot = 0; |
| 11640 | + bool dot_is_file = true; |
| 11641 | + for (;;) { |
| 11642 | + slashdot = input.find("/.", slashdot); |
| 11643 | + if (slashdot == std::string_view::npos) { // common case |
| 11644 | + break; |
| 11645 | + } else { // uncommon |
| 11646 | + // only three cases matter: /./, /.. or a final / |
| 11647 | + slashdot += 2; |
| 11648 | + dot_is_file &= !(slashdot == input.size() || input[slashdot] == '.' || |
| 11649 | + input[slashdot] == '/'); |
| 11650 | + } |
11647 | 11651 | } |
| 11652 | + trivial_path = dot_is_file; |
11648 | 11653 | } |
11649 | 11654 | } |
11650 | 11655 | if (trivial_path) { |
@@ -15093,15 +15098,20 @@ inline void url_aggregator::consume_prepared_path(std::string_view input) { |
15093 | 15098 | // Note: input cannot be empty, it must at least contain one character ('.') |
15094 | 15099 | // Note: we know that '\' is not present. |
15095 | 15100 | if (input[0] != '.') { |
15096 | | - size_t slashdot = input.find("/."); |
15097 | | - if (slashdot == std::string_view::npos) { // common case |
15098 | | - trivial_path = true; |
15099 | | - } else { // uncommon |
15100 | | - // only three cases matter: /./, /.. or a final / |
15101 | | - trivial_path = |
15102 | | - !(slashdot + 2 == input.size() || input[slashdot + 2] == '.' || |
15103 | | - input[slashdot + 2] == '/'); |
| 15101 | + size_t slashdot = 0; |
| 15102 | + bool dot_is_file = true; |
| 15103 | + for (;;) { |
| 15104 | + slashdot = input.find("/.", slashdot); |
| 15105 | + if (slashdot == std::string_view::npos) { // common case |
| 15106 | + break; |
| 15107 | + } else { // uncommon |
| 15108 | + // only three cases matter: /./, /.. or a final / |
| 15109 | + slashdot += 2; |
| 15110 | + dot_is_file &= !(slashdot == input.size() || input[slashdot] == '.' || |
| 15111 | + input[slashdot] == '/'); |
| 15112 | + } |
15104 | 15113 | } |
| 15114 | + trivial_path = dot_is_file; |
15105 | 15115 | } |
15106 | 15116 | } |
15107 | 15117 | if (trivial_path && is_at_path()) { |
|
0 commit comments