Skip to content

Instantly share code, notes, and snippets.

@jsamsa
Created December 11, 2009 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsamsa/254166 to your computer and use it in GitHub Desktop.
Save jsamsa/254166 to your computer and use it in GitHub Desktop.
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