Skip to content

Commit 514b2d1

Browse files
committed
Use absolutize_paths to make userdir and path absolute
1 parent c0059cf commit 514b2d1

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

nb/ide.launcher/unix/netbeans

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ case "`uname -s -m`" in
5757
;;
5858
esac
5959

60+
absolutize_paths() {
61+
while read path; do
62+
if [ -d "$path" ]; then
63+
(cd "$path" 2>/dev/null && pwd)
64+
else
65+
echo "$path"
66+
fi
67+
done
68+
}
69+
6070
# $HOME can be used as it is present on mac OS and
6171
BASEDIR=$basedir
6272

@@ -73,7 +83,7 @@ export DEFAULT_USERDIR_ROOT
7383

7484
if ! [ "$NETBEANS_USERDIR" = "IGNORE" ]; then
7585
# make sure own launcher directory is on PATH as a fallback
76-
PATH=$PATH:$progdir
86+
PATH=$PATH:`echo $progdir | absolutize_paths`
7787
fi
7888

7989
# #68373: look for userdir, but do not modify "$@"
@@ -123,16 +133,6 @@ readClusters() {
123133
done
124134
}
125135

126-
absolutize_paths() {
127-
while read path; do
128-
if [ -d "$path" ]; then
129-
(cd "$path" 2>/dev/null && pwd)
130-
else
131-
echo "$path"
132-
fi
133-
done
134-
}
135-
136136
netbeans_clusters=`readClusters | absolutize_paths | tr '\012' ':'`
137137

138138
if [ ! -z "$netbeans_extraclusters" ] ; then
@@ -153,7 +153,7 @@ launchNbexec() {
153153
then
154154
sh=/bin/bash
155155
fi
156-
NETBEANS_USERDIR=${userdir}
156+
NETBEANS_USERDIR=`echo ${userdir} | absolutize_paths`
157157
export NETBEANS_USERDIR
158158
if [ "${founduserdir}" = "yes" ]; then
159159
exec $sh "$nbexec" "$@"

0 commit comments

Comments
 (0)