Browse files

fix to check whether file has extention or not

  • Loading branch information...
1 parent 1616119 commit 6780a43e79af1bb61a118b0d2082c64e8252d834 @liquidz committed Mar 18, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/watchtower/core.clj
View
3 src/watchtower/core.clj
@@ -103,5 +103,6 @@
(let [exts-set (set (map name exts))]
(fn [f]
(let [fname (.getName f)
- cur (subs fname (inc (.lastIndexOf fname ".")))]
+ idx (.lastIndexOf fname ".")
+ cur (if-not (neg? idx) (subs fname (inc idx)))]
(exts-set cur)))))

0 comments on commit 6780a43

Please sign in to comment.