subst current_blocks with ok_to_continue

This commit is contained in:
holger krekel
2019-08-17 01:29:26 +02:00
parent 2bddb8409c
commit 64beb17fa6

View File

@@ -1077,7 +1077,7 @@ unsafe fn dc_mimeparser_add_single_part_if_known(
mimeparser: &mut dc_mimeparser_t, mimeparser: &mut dc_mimeparser_t,
mime: *mut mailmime, mime: *mut mailmime,
) -> libc::c_int { ) -> libc::c_int {
let mut current_block: u64; let mut ok_to_continue = true;
let old_part_count = mimeparser.parts.len(); let old_part_count = mimeparser.parts.len();
let mime_type: libc::c_int; let mime_type: libc::c_int;
let mime_data: *mut mailmime_data; let mime_data: *mut mailmime_data;
@@ -1134,14 +1134,12 @@ unsafe fn dc_mimeparser_add_single_part_if_known(
info!(mimeparser.context, 0, "decoded message: '{}'", res); info!(mimeparser.context, 0, "decoded message: '{}'", res);
if res.is_empty() { if res.is_empty() {
/* no error - but nothing to add */ /* no error - but nothing to add */
current_block = 8795901732489102124; ok_to_continue = false;
} else { } else {
let b = res.as_bytes(); let b = res.as_bytes();
decoded_data = b.as_ptr() as *const libc::c_char; decoded_data = b.as_ptr() as *const libc::c_char;
decoded_data_bytes = b.len(); decoded_data_bytes = b.len();
std::mem::forget(res); std::mem::forget(res);
current_block = 17788412896529399552;
} }
} else { } else {
warn!( warn!(
@@ -1151,14 +1149,9 @@ unsafe fn dc_mimeparser_add_single_part_if_known(
decoded_data_bytes as libc::c_int, decoded_data_bytes as libc::c_int,
as_str(charset), as_str(charset),
); );
current_block = 17788412896529399552;
} }
} else {
current_block = 17788412896529399552;
} }
match current_block { if ok_to_continue {
8795901732489102124 => {}
_ => {
/* check header directly as is_send_by_messenger is not yet set up */ /* check header directly as is_send_by_messenger is not yet set up */
let is_msgrmsg = (!dc_mimeparser_lookup_optional_field( let is_msgrmsg = (!dc_mimeparser_lookup_optional_field(
&mimeparser, &mimeparser,
@@ -1189,8 +1182,6 @@ unsafe fn dc_mimeparser_add_single_part_if_known(
if simplifier.unwrap().is_forwarded { if simplifier.unwrap().is_forwarded {
mimeparser.is_forwarded = 1i32 mimeparser.is_forwarded = 1i32
} }
current_block = 10261677128829721533;
}
} }
} }
80 | 90 | 100 | 110 | 111 => { 80 | 90 | 100 | 110 | 111 => {
@@ -1292,16 +1283,11 @@ unsafe fn dc_mimeparser_add_single_part_if_known(
b"file.%s\x00" as *const u8 as *const libc::c_char, b"file.%s\x00" as *const u8 as *const libc::c_char,
(*(*mime).mm_content_type).ct_subtype, (*(*mime).mm_content_type).ct_subtype,
); );
current_block = 17019156190352891614;
} else { } else {
current_block = 8795901732489102124; ok_to_continue = false;
} }
} else {
current_block = 17019156190352891614;
} }
match current_block { if ok_to_continue {
8795901732489102124 => {}
_ => {
if strncmp( if strncmp(
desired_filename, desired_filename,
b"location\x00" as *const u8 as *const libc::c_char, b"location\x00" as *const u8 as *const libc::c_char,
@@ -1320,7 +1306,6 @@ unsafe fn dc_mimeparser_add_single_part_if_known(
decoded_data, decoded_data,
decoded_data_bytes, decoded_data_bytes,
)); ));
current_block = 8795901732489102124;
} else if strncmp( } else if strncmp(
desired_filename, desired_filename,
b"message\x00" as *const u8 as *const libc::c_char, b"message\x00" as *const u8 as *const libc::c_char,
@@ -1339,7 +1324,6 @@ unsafe fn dc_mimeparser_add_single_part_if_known(
decoded_data, decoded_data,
decoded_data_bytes, decoded_data_bytes,
)); ));
current_block = 8795901732489102124;
} else { } else {
dc_replace_bad_utf8_chars(desired_filename); dc_replace_bad_utf8_chars(desired_filename);
do_add_single_file_part( do_add_single_file_part(
@@ -1351,17 +1335,9 @@ unsafe fn dc_mimeparser_add_single_part_if_known(
decoded_data_bytes, decoded_data_bytes,
desired_filename, desired_filename,
); );
current_block = 10261677128829721533;
} }
}
} }
} }
_ => {
current_block = 10261677128829721533;
}
}
match current_block {
8795901732489102124 => {}
_ => {} _ => {}
} }
} }