Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions quotequail/_internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,15 +254,15 @@ def unwrap(lines, max_wrap_lines, min_header_lines, min_quoted_lines):
return main_type, (0, start), headers, (quoted_start, rest_start), (rest_start, None), True

elif typ == 'headers':
hdrs, hdrs_length = extract_headers(lines[start+1:], max_wrap_lines)
hdrs, hdrs_length = extract_headers(lines[end+1:], max_wrap_lines)
if hdrs:
headers.update(hdrs)
rest_start = start + 1 + hdrs_length
rest_start = end + 1 + hdrs_length
return main_type, (0, start), headers, (rest_start, None), None, False
else:
# Didn't find quoted section or headers, assume that everything
# below is the qouted text.
return main_type, (0, start), headers, (start+(start2 or 0)+1, None), None, False
return main_type, (0, start), headers, (end+(start2 or 0)+1, None), None, False

# We just found headers, which usually indicates a forwarding.
elif typ == 'headers':
Expand All @@ -283,4 +283,4 @@ def unwrap(lines, max_wrap_lines, min_header_lines, min_quoted_lines):
return main_type, (0, start), hdrs, (rest2_start, rest_start), (rest_start, None), True
else:
main_type = 'quote'
return main_type, (None, start), None, (start, rest_start), (rest_start, None), True
return main_type, (0, start), None, (start, rest_start), (rest_start, None), True