cp: avoid unnecessary buffer allocation
commit3f7519130a3702b69e9505611a39f2791de0d3b1
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 21 Feb 2022 08:18:19 +0000 (21 00:18 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 21 Feb 2022 08:19:24 +0000 (21 00:19 -0800)
tree062f177b6f37551e5a0a6a1213a25eaa0c803fff
parent7dbe465fd3131825f61f072647459bee39d448ee
cp: avoid unnecessary buffer allocation

Do not allocate I/O buffer if copy_file_range suffices.
* src/copy.c (sparse_copy, lseek_copy): Buffer arg is now char **
instead of char *, and buffer is now allocated only if needed.
All uses changed.
src/copy.c