Permalink
Browse files

Fix a bug where we would not try to complete paths starting with ../

  • Loading branch information...
1 parent 4539e8d commit 57bb48b1f2d55c0e098f45336a4651076f11a047 Phil Crosby committed Sep 9, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 fuzzycd.rb
View
@@ -102,7 +102,7 @@ def matches_for_path(path)
# Just invoke cd directly in certain special cases (e.g. when the path is empty, ends in "/" or exactly
# matches a directory).
-if cd_path.nil? || [".", "/", "-", ENV["HOME"]].include?(cd_path) || cd_path =~ /\.\.(\/\.\.)*/ ||
+if cd_path.nil? || [".", "/", "-", ENV["HOME"]].include?(cd_path) || cd_path =~ /^\.\.(\/\.\.)*$/ ||
cd_path.rindex("/") == cd_path.size - 1 || File.directory?(cd_path)
@out.puts "@passthrough"
exit

0 comments on commit 57bb48b

Please sign in to comment.