diff --git a/src/reuse/header.py b/src/reuse/header.py index 9ad071c3b..a84c29ad6 100644 --- a/src/reuse/header.py +++ b/src/reuse/header.py @@ -294,7 +294,8 @@ def find_and_replace_header( if before.strip(): new_text = f"{before.rstrip()}\n\n{new_text}" if after.strip(): - new_text = f"{new_text}\n{after.lstrip()}" + newline = "\n" + new_text = f"{new_text}\n{after.lstrip(newline)}" return new_text