summaryrefslogtreecommitdiffstats
path: root/vendor/url/src/parser.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /vendor/url/src/parser.rs
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/url/src/parser.rs')
-rw-r--r--vendor/url/src/parser.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/vendor/url/src/parser.rs b/vendor/url/src/parser.rs
index 765cc027c..7d94d1d71 100644
--- a/vendor/url/src/parser.rs
+++ b/vendor/url/src/parser.rs
@@ -184,17 +184,13 @@ pub struct Input<'i> {
}
impl<'i> Input<'i> {
- pub fn new(input: &'i str) -> Self {
- Input::with_log(input, None)
- }
-
- pub fn no_trim(input: &'i str) -> Self {
+ pub fn new_no_trim(input: &'i str) -> Self {
Input {
chars: input.chars(),
}
}
- pub fn trim_tab_and_newlines(
+ pub fn new_trim_tab_and_newlines(
original_input: &'i str,
vfn: Option<&dyn Fn(SyntaxViolation)>,
) -> Self {
@@ -212,7 +208,10 @@ impl<'i> Input<'i> {
}
}
- pub fn with_log(original_input: &'i str, vfn: Option<&dyn Fn(SyntaxViolation)>) -> Self {
+ pub fn new_trim_c0_control_and_space(
+ original_input: &'i str,
+ vfn: Option<&dyn Fn(SyntaxViolation)>,
+ ) -> Self {
let input = original_input.trim_matches(c0_control_or_space);
if let Some(vfn) = vfn {
if input.len() < original_input.len() {
@@ -362,7 +361,7 @@ impl<'a> Parser<'a> {
/// https://url.spec.whatwg.org/#concept-basic-url-parser
pub fn parse_url(mut self, input: &str) -> ParseResult<Url> {
- let input = Input::with_log(input, self.violation_fn);
+ let input = Input::new_trim_c0_control_and_space(input, self.violation_fn);
if let Ok(remaining) = self.parse_scheme(input.clone()) {
return self.parse_with_scheme(remaining);
}
@@ -1203,6 +1202,7 @@ impl<'a> Parser<'a> {
_ => {
self.check_url_code_point(c, &input);
if scheme_type.is_file()
+ && self.serialization.len() > path_start
&& is_normalized_windows_drive_letter(
&self.serialization[path_start + 1..],
)