summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2017-05-02 15:02:49 +0200
committerJean Delvare <jdelvare@suse.de>2017-05-02 15:02:49 +0200
commit102ab72dc48297be33d62dbe73536a714bcbf464 (patch)
tree99759ab1a50547776b6451b229a01e16432982b2 /test
parent7080e2ad44f79a2660d5d56c24b6dff846b32260 (diff)
downloadquilt-102ab72dc48297be33d62dbe73536a714bcbf464.tar.gz
header: Fix patch corruption when trailing newline is missing
When editing a patch header with certain editors, it is possible that no trailing newline character is present on the last line. In such case, the patch would be corrupted. Prevent that by ensuring that a newline character is always present. This fixes bug #50841: https://savannah.nongnu.org/bugs/?50841 Signed-off-by: Jean Delvare <jdelvare@suse.de>
Diffstat (limited to 'test')
-rw-r--r--test/header.test13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/header.test b/test/header.test
index f6367b5..7e0cbca 100644
--- a/test/header.test
+++ b/test/header.test
@@ -42,3 +42,16 @@
> @@ -1 +1 @@
> -foo
> +bar
+
+ $ echo -n "No trailing newline" | quilt header -r
+ > Replaced header of patch patches/patch
+
+ $ cat patches/patch
+ > No trailing newline
+ > Index: b/foo
+ > ===================================================================
+ > --- a/foo
+ > +++ b/foo
+ > @@ -1 +1 @@
+ > -foo
+ > +bar