Opened 9 years ago

Last modified 9 years ago

#48955 new defect

clojure @1.6.0 Unable to open the clj interpreter when inside a path with spaces

Reported by: riccardo.dimeo42@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: Cc:
Port: clojure

Description

The clj script behaves incorrectly when executed within a path that contains one or more spaces:

$ pwd
/tmp/a directory with spaces/another_dir
$ clj
Error: Could not find or load main class directory
$ echo $?
1

The problem is in the clj file itself (a script) which doesn't quote correctly the variables $cp and $cljclass

By replacing the block:

if [ -z "$1" ]; then
  exec java -classpath $cp $cljclass
else
  exec java -classpath $cp $cljclass $*
fi

with

if [ -z "$1" ]; then
  exec java -classpath "$cp" "$cljclass"
else
  exec java -classpath "$cp" "$cljclass" $*
fi

the clj file works as expected:

$ clj
Clojure 1.6.0
user=> 

Change History (1)

comment:1 Changed 9 years ago by mf2k (Frank Schima)

Keywords: clj clojure path spaces removed
Note: See TracTickets for help on using tickets.