split: ensure output doesn't overwrite input
authorPádraig Brady <P@draigBrady.com>
Fri, 22 Jun 2012 08:32:34 +0000 (09:32 +0100)
committerPádraig Brady <P@draigBrady.com>
Fri, 22 Jun 2012 10:34:21 +0000 (11:34 +0100)
commitae5846448f73d90ba9bd01cc9edc94bc0b168e46
tree86d73149007b304586c0d8604ab39d0436528089
parent30a604e631291b80b9812e03e0f325489ae0d77e
split: ensure output doesn't overwrite input

* src/split.c (create): Check if output file is the
same inode as the input file.
* tests/split/guard-input: New test case.
* tests/Makefile.am: Reference new test case.
* NEWS: Mention the fix.

Improved-by: Jim Meyering
Reported-by: François Pinard
NEWS
src/split.c
tests/Makefile.am
tests/split/guard-input [new file with mode: 0755]