Skip to content

Commit

Permalink
Handle case with newline ending
Browse files Browse the repository at this point in the history
  • Loading branch information
pierotofy committed Dec 30, 2023
1 parent e1d9d05 commit aba63b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dedup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ std::tuple<std::string, std::string, size_t> dedup(const std::string &src, const
lines.emplace(hash, line_view);

src_of << line_view;
tgt_of << line_buf << "\n";
tgt_of << line_buf << (*ptr == '\n' ? "\n" : "");
}else{
removed++;
}
Expand Down

0 comments on commit aba63b9

Please sign in to comment.