Skip to content

Commit

Permalink
Be defensive about path seperators
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeSanMichel2 authored and Sarcasm committed Oct 16, 2015
1 parent 7c2572c commit 3e9d37c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions irony-cdb.el
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ Returns nil if paths isn't a list of at least one element.
with best-depth-delta = 999999 ; start at +inf
with best-path = nil ; we keep the best so far here
;; all candidates have their depth compared to that of target file
with file-depth = (length (split-string file "/")) ;
for candidate-depth = (length (split-string path "/"))
with file-depth = (length (split-string (expand-file-name file) "/")) ;
for candidate-depth = (length (split-string (expand-file-name path) "/"))
;; Our metric. We use signum as a tie-breaker to choose deeper candidates
for depth-delta = (+ (abs (- file-depth candidate-depth))
(* 0.1 (- file-depth candidate-depth)))
Expand Down

0 comments on commit 3e9d37c

Please sign in to comment.