use \0 instead of \n

This commit is contained in:
volth 2017-08-13 14:03:05 +00:00 committed by GitHub
parent b971f8de8e
commit 4ebeb7d782

View File

@ -4,7 +4,7 @@ updateSourceDateEpoch() {
# Get the last modification time of all regular files, sort them,
# and get the most recent. Maybe we should use
# https://github.com/0-wiz-0/findnewest here.
local -a res=($(find "$path" -type f -not -newer "$NIX_BUILD_TOP/.." -printf '%T@ %p\n' | sort -n | tail -n1))
local -a res=($(find "$path" -type f -not -newer "$NIX_BUILD_TOP/.." -printf '%T@ %p\0' | sort -n --zero-terminated | tail -n1 --zero-terminated))
local time="${res[0]//\.[0-9]*/}" # remove the fraction part
local newestFile="${res[1]}"