summaryrefslogtreecommitdiffstats
path: root/melib/src/email/parser.rs
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2020-06-20 11:13:50 +0300
committerManos Pitsidianakis <el13635@mail.ntua.gr>2020-06-20 13:14:40 +0300
commit01d83d80880f4327881dc7ea1c746e747f906ade (patch)
tree4fcc217c71ccc7fd2ea9b282398da3781e011809 /melib/src/email/parser.rs
parent8bfdce6658b3adbbf487923c512e68cac58fef68 (diff)
email/parser: do not set has_colon newline
When parsing a field-name, and expecting a colon (:) if a newline is first encountered do not set `has_colon` flag to true.
Diffstat (limited to 'melib/src/email/parser.rs')
-rw-r--r--melib/src/email/parser.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/melib/src/email/parser.rs b/melib/src/email/parser.rs
index 99722350..cc9c8f7e 100644
--- a/melib/src/email/parser.rs
+++ b/melib/src/email/parser.rs
@@ -405,11 +405,15 @@ pub mod headers {
name = &input[0..i];
ptr = i + 2;
break;
- } else if *x == b':' || *x == b'\n' {
+ } else if *x == b':' {
name = &input[0..i];
has_colon = true;
ptr = i;
break;
+ } else if *x == b'\n' {
+ name = &input[0..i];
+ ptr = i;
+ break;
} else if is_ctl_or_space!(*x) {
return Err(nom::Err::Error((
input,