erlang/otp-0008-Avoid-forking-sed-to-get-basename.patch
Peter Lemenkov d8da3b9c78 Erlang ver. 24.0-rc2
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
2021-04-04 00:08:20 +02:00

32 lines
867 B
Diff

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