graft: Correctly replace references near the end of the scan buffer.
authorLudovic Courtès <ludo@gnu.org>
Thu, 24 Aug 2017 11:14:47 +0000 (13:14 +0200)
committerLudovic Courtès <ludo@gnu.org>
Thu, 24 Aug 2017 21:55:51 +0000 (23:55 +0200)
commit94e86a6b67c7a02f5f11358743f3b9f11997059c
tree11a28c7422f0fcb366b4d263a4d635f693c83ee0
parent5e60bef9802e448924f889d34d95a249b008652c
graft: Correctly replace references near the end of the scan buffer.

Fixes <http://bugs.gnu.org/28212>.
Reported by Leo Famulari <leo@famulari.name>.

* guix/build/graft.scm (replace-store-references): When I >= END, check
whether WRITTEN > END and call 'get-bytevector-n!' when it is.
* tests/grafts.scm (buffer-size): New variable.
("replace-store-references, <http://bugs.gnu.org/28212>"): New test.
guix/build/graft.scm
tests/grafts.scm