`repocutter pathrename` breaks output if target path is longer
Using a fresh checkout of the Reposurgeon repository and go1.11.5 linux/amd64, repocutter pathrename
produces a broken result, if the target path is longer than the source path. For reproduction you can use the trivial Subversion dump dummyrep.svn (a single commit with a single file) and run these commands:
$ make all
[...]
$ ./repoctter pathrename hello.txt hello-world.txt <dummyrep.svn >dummyrep-out.svn
Transform path headers with a regexp replace......(328.484µs) done.
Then check the differences between the input and the output file:
--- dummyrep.svn 2019-04-18 15:32:10.857677745 +0200
+++ dummyrep-out.svn 2019-04-18 15:32:29.136608178 +0200
@@ -30,8 +30,7 @@
First commit
PROPS-END
-Node-path: hello.txt
-Node-kind: file
+Node-path: hello-world.txtld.txtkind: file
Node-action: add
Prop-content-length: 10
Text-content-length: 14
Apparently the new Node-path line does not end where it should, i.e. right after "hello-world.txt". Instead the Node-kind line follows with its first bytes (and the preceding newline) overwritten with "ld.txt".