From c1f551e00db12429b9df006ec200a56845d0f753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 27 Jul 2021 17:54:52 +0200 Subject: whereispatch: Ensure patch path does not contain newlines --- bin/whereispatch | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/bin/whereispatch b/bin/whereispatch index 1eea64a..0300663 100755 --- a/bin/whereispatch +++ b/bin/whereispatch @@ -2,7 +2,9 @@ # whereispatch -- print corresponding patch directory -root=/home/john/patches +IFS=' +' +: ${PATCHROOT:=/home/$USER/patches} case "$PWD" in /usr/pkgsrc/*) dir=$(pwd | cut -d/ -f4,5) || dir= ;; @@ -17,4 +19,14 @@ if [ -z "$dir" ]; then read dir &2 + exit 1 +fi + +echo $dir -- cgit v1.2.3