Skip to content

Commit f3adc53

Browse files
committed
make header tests work
1 parent eec77d5 commit f3adc53

File tree

4 files changed

+345
-167
lines changed

4 files changed

+345
-167
lines changed

include/bio/format/sam_input_handler.hpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,14 @@ class format_input_handler<sam> : public format_input_handler_base<format_input_
221221
header_string += file_it->line;
222222
header_string += "\n";
223223
}
224-
header = map_io::header<std::vector<std::string>>{std::move(header_string)};
224+
225+
if (header_string.ends_with("\r\n"))
226+
header_string = header_string.substr(0, header_string.size() - 2);
227+
else if (header_string.ends_with("\n"))
228+
header_string = header_string.substr(0, header_string.size() - 1);
229+
230+
header = map_io::header<std::vector<std::string>>{};
231+
header.read(header_string);
225232
}
226233

227234
auto const & get_header() const { return header; }

0 commit comments

Comments
 (0)