Skip to content

Commit 5e2bcf1

Browse files
committed
fix for #22461 jar with empty ClassPath attribute
1 parent ef7f217 commit 5e2bcf1

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

compiler/src/dotty/tools/dotc/classpath/ClassPathFactory.scala

+3-1
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ class ClassPathFactory {
6969
a <- ClassPath.expandManifestPath(file.absolutePath)
7070
path = java.nio.file.Paths.get(a.toURI()).nn
7171
if Files.exists(path)
72+
entry = AbstractFile.getFile(path)
73+
if Option(entry).nonEmpty
7274
yield
73-
newClassPath(AbstractFile.getFile(path))
75+
newClassPath(entry)
7476
else
7577
Seq.empty
7678

dist/libexec/common-shared

+7-12
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,16 @@
66
# * Credits: This script is based on the script generated by sbt-pack.
77
# *--------------------------------------------------------------------------*/
88

9-
if [ -e /usr/bin/tty -a "`tty`" != "not a tty" -a ! -p /dev/stdin ]; then
10-
isterminal=1
11-
# save terminal settings
12-
saved_stty=$(stty -g 2>/dev/null)
13-
# clear on error so we don't later try to restore them
14-
if [[ ! $? ]]; then
15-
saved_stty=""
16-
fi
17-
else
18-
isterminal=0
9+
# save terminal settings
10+
saved_stty=$(stty -g 2>/dev/null)
11+
# clear on error so we don't later try to restore them
12+
if [[ ! $? ]]; then
13+
saved_stty=""
1914
fi
2015

2116
# restore stty settings (echo in particular)
2217
function restoreSttySettings() {
23-
[ $isterminal -eq 1 ] && stty $saved_stty
18+
stty $saved_stty
2419
saved_stty=""
2520
}
2621

@@ -66,7 +61,7 @@ if [[ ${cygwin-} || ${mingw-} || ${msys-} ]]; then
6661
CYGPATHCMD=`which cygpath 2>/dev/null`
6762
case "$TERM" in
6863
rxvt* | xterm* | cygwin*)
69-
[ $isterminal -eq 1 ] && stty -icanon min 1 -echo
64+
stty -icanon min 1 -echo
7065
JAVA_OPTS="$JAVA_OPTS -Djline.terminal=unix"
7166
;;
7267
esac

0 commit comments

Comments
 (0)