Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
diff --git a/src/swank/util/class_browse.clj b/src/swank/util/class_browse.clj
index 449df6e..8d6cfbc 100644
--- a/src/swank/util/class_browse.clj
+++ b/src/swank/util/class_browse.clj
@@ -22,7 +22,8 @@
:file Path of the class file, relative to :loc"
(:import [java.io File FilenameFilter]
[java.util StringTokenizer]
- [java.util.jar JarFile JarEntry]))
+ [java.util.jar JarFile JarEntry]
+ [java.util.regex Pattern]))
;;; Class file naming, categorization
@@ -88,7 +89,7 @@
;; location. Make sure it decends; a class can't be on classpath directly.
[#^File f #^File loc]
(let [fp (.getPath f), lp (.getPath loc)
- m (re-matcher (re-pattern (str "^" lp File/separator)) fp)]
+ m (re-matcher (re-pattern (Pattern/quote (str "^" lp File/separator))) fp)]
(if (not (.find m)) ; must be descendent of loc
[]
(let [fpr (.substring fp (.end m))]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.