From 3e9d37cb9a7b6feca2606ba6919b267deebe3531 Mon Sep 17 00:00:00 2001 From: MikeSanMichel2 Date: Fri, 16 Oct 2015 23:50:37 +0300 Subject: [PATCH] Be defensive about path seperators --- irony-cdb.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/irony-cdb.el b/irony-cdb.el index da0fb654..1c9d0de9 100644 --- a/irony-cdb.el +++ b/irony-cdb.el @@ -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)))