Skip to content

Commit edcdf6e

Browse files
committed
Only expand ~ in classpath entries when followed by / or $
Otherwise, entries like `~foo` would expand to something like `/home/userfoo`.
1 parent 0eed1ab commit edcdf6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/nvd/task/check.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
(re-pattern (str File/pathSeparatorChar)))
4242

4343
(defn absolute-path ^String [file]
44-
(s/replace-first file #"^~" (System/getProperty "user.home")))
44+
(s/replace-first file #"^~(?=$|/)" (System/getProperty "user.home")))
4545

4646
(defn parse-classpath
4747
"Accepts a classpath string (i.e. colon-separated paths) and returns a sequence of analyzable

0 commit comments

Comments
 (0)