Blame otp-0009-Avoid-forking-sed-to-get-basename.patch

bd508a
From: Jan Pazdziora <jpazdziora@redhat.com>
bd508a
Date: Thu, 10 May 2018 18:35:02 +0200
bd508a
Subject: [PATCH] Avoid forking sed to get basename.
bd508a
bd508a
bd508a
diff --git a/erts/etc/unix/erl.src.src b/erts/etc/unix/erl.src.src
bd508a
index 959c099e8f..861b8bcbf1 100644
bd508a
--- a/erts/etc/unix/erl.src.src
bd508a
+++ b/erts/etc/unix/erl.src.src
bd508a
@@ -21,7 +21,7 @@
bd508a
 ROOTDIR="%FINAL_ROOTDIR%"
bd508a
 BINDIR=$ROOTDIR/erts-%VSN%/bin
bd508a
 EMU=%EMULATOR%%EMULATOR_NUMBER%
bd508a
-PROGNAME=`echo $0 | sed 's/.*\///'`
bd508a
+PROGNAME=${0##*/}
bd508a
 export EMU
bd508a
 export ROOTDIR
bd508a
 export BINDIR
bd508a
diff --git a/erts/etc/unix/start_erl.src b/erts/etc/unix/start_erl.src
bd508a
index 34e0369710..62e613bba1 100644
bd508a
--- a/erts/etc/unix/start_erl.src
bd508a
+++ b/erts/etc/unix/start_erl.src
bd508a
@@ -37,7 +37,7 @@ VSN=`awk '{print $2}' $DataFile`
bd508a
 
bd508a
 BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin
bd508a
 EMU=beam
bd508a
-PROGNAME=`echo $0 | sed 's/.*\///'`
bd508a
+PROGNAME=${0##*/}
bd508a
 export EMU
bd508a
 export ROOTDIR
bd508a
 export BINDIR