From 6df168f8c1243664ef83e76ff72a06de2ca5c20f Mon Sep 17 00:00:00 2001 From: Lewis Cook Date: Sun, 30 Jul 2023 01:56:44 +0100 Subject: [PATCH] init: Fix error upon deleting file on non-GNU systems --- src/init.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/init.lua b/src/init.lua index 296e62a..c3245b9 100644 --- a/src/init.lua +++ b/src/init.lua @@ -1995,7 +1995,9 @@ xplr.config.modes.builtin.delete = { messages = { { BashExec0 = [===[ - cat "${XPLR_PIPE_RESULT_OUT:?}" | xargs -0 printf '%q\n' + while IFS= read -r -d '' PTH; do + printf '%q\n' "$PTH" + done < "${XPLR_PIPE_RESULT_OUT:?}" echo read -p "Permanently delete these files? [Y/n]: " ANS [ "${ANS:-Y}" = "Y" ] || [ "$ANS" = "y" ] || exit 0 @@ -2023,7 +2025,9 @@ xplr.config.modes.builtin.delete = { messages = { { BashExec0 = [===[ - cat "${XPLR_PIPE_RESULT_OUT:?}" | xargs -0 printf '%q\n' + while IFS= read -r -d '' PTH; do + printf '%q\n' "$PTH" + done < "${XPLR_PIPE_RESULT_OUT:?}" echo read -p "Permanently delete these files? [Y/n]: " ANS [ "${ANS:-Y}" = "Y" ] || [ "$ANS" = "y" ] || exit 0