diff --git a/wayland-scanner/src/parse.rs b/wayland-scanner/src/parse.rs index c8dc2a62245..55611fbfa31 100644 --- a/wayland-scanner/src/parse.rs +++ b/wayland-scanner/src/parse.rs @@ -54,9 +54,9 @@ fn parse_or_panic(txt: &[u8]) -> T { fn init_protocol(reader: &mut Reader) -> Protocol { // Check two firsts lines for protocol tag - for _ in 0..2 { + for _ in 0..3 { match reader.read_event_into(&mut Vec::new()) { - Ok(Event::Decl(_)) => { + Ok(Event::Decl(_) | Event::DocType(_)) => { continue; } Ok(Event::Start(bytes)) => {