summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2020-01-31 17:22:33 +0100
committerGitHub <noreply@github.com>2020-01-31 17:22:33 +0100
commit6124187883922536808d09a5573c959c950e8aa3 (patch)
treee17ddbd006d25baf187fc4e40b62deecbf2a7496
parent040dca40e4829c7fb2f7131918f1592987897637 (diff)
downloadcouchdb-6124187883922536808d09a5573c959c950e8aa3.tar.gz
fix: re-allow spaces in startup paths (#2504)
-rwxr-xr-xrel/files/couchdb.in10
-rwxr-xr-xrel/overlay/bin/remsh10
2 files changed, 10 insertions, 10 deletions
diff --git a/rel/files/couchdb.in b/rel/files/couchdb.in
index 3d7ee1119..c6ee7c933 100755
--- a/rel/files/couchdb.in
+++ b/rel/files/couchdb.in
@@ -14,15 +14,15 @@
canonical_readlink ()
{
- cd $(dirname $1);
- FILE=$(basename $1);
+ FILE=$(dirname "$1")/$(basename "$1");
if [ -h "$FILE" ]; then
- canonical_readlink $(readlink $FILE);
+ cd $(dirname "$1")
+ canonical_readlink $(readlink "$FILE");
else
- echo "$(pwd -P)";
+ cd "${1%/*}" && pwd -P;
fi
}
-COUCHDB_BIN_DIR=$(canonical_readlink $0)
+COUCHDB_BIN_DIR=$(canonical_readlink "$0")
ERTS_BIN_DIR=$COUCHDB_BIN_DIR/../
cd "$COUCHDB_BIN_DIR/../"
diff --git a/rel/overlay/bin/remsh b/rel/overlay/bin/remsh
index b8946ace3..c5e932a8d 100755
--- a/rel/overlay/bin/remsh
+++ b/rel/overlay/bin/remsh
@@ -14,15 +14,15 @@
canonical_readlink ()
{
- cd $(dirname $1);
- FILE=$(basename $1);
+ FILE=$(dirname "$1")/$(basename "$1");
if [ -h "$FILE" ]; then
- canonical_readlink $(readlink $FILE);
+ cd $(dirname "$1")
+ canonical_readlink $(readlink "$FILE");
else
- echo "$(pwd -P)";
+ cd "${1%/*}" && pwd -P;
fi
}
-COUCHDB_BIN_DIR=$(canonical_readlink $0)
+COUCHDB_BIN_DIR=$(canonical_readlink "$0")
ERTS_BIN_DIR=$COUCHDB_BIN_DIR/../
ROOTDIR=${ERTS_BIN_DIR%/*}
START_ERL=$(cat "$ROOTDIR/releases/start_erl.data")