From cbab19ba55cf06140a97e217f9fa07d1fe809c6b Mon Sep 17 00:00:00 2001
From: Rob Landley <rob@landley.net>
Date: Fri, 22 Nov 2019 08:47:35 -0600
Subject: Sigh. Third attempt to fix trailing slashes in singlemake PREFIX. (So
 much jetlag.)

---
 scripts/single.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/single.sh b/scripts/single.sh
index a0f2c571..98a7af30 100755
--- a/scripts/single.sh
+++ b/scripts/single.sh
@@ -8,6 +8,9 @@ then
   exit 1
 fi
 
+# Add trailing / to PREFIX when it's set but hasn't got one
+[ "$PREFIX" == "${PREFIX%/}" ] && PREFIX="${PREFIX:+$PREFIX/}"
+
 # Harvest TOYBOX_* symbols from .config
 if [ ! -e .config ]
 then
@@ -41,7 +44,7 @@ do
   echo "# CONFIG_TOYBOX is not set" >> "$KCONFIG_CONFIG" &&
   grep "CONFIG_TOYBOX_" .config >> "$KCONFIG_CONFIG" &&
 
-  export OUTNAME="${PREFIX:+/$PREFIX}$i"
+  export OUTNAME="$PREFIX$i"
   rm -f "$OUTNAME" &&
   scripts/make.sh || exit 1
 done
-- 
cgit v1.2.3