1
0
mirror of https://github.com/wting/autojump synced 2024-09-28 22:10:45 +00:00

weird corner cases

This commit is contained in:
Joël Schaerer 2010-01-26 16:47:13 +01:00
parent c928c78aaa
commit c533b2b4fd

View File

@ -37,7 +37,10 @@ def dicadd(dic,key,increment=1):
def match(path,pattern,path_dict,re_flags=0): def match(path,pattern,path_dict,re_flags=0):
import re import re
try:
if os.path.realpath(os.curdir)==path : return False if os.path.realpath(os.curdir)==path : return False
except OSError: #sometimes the current path doesn't exist anymore. In that case, jump if possible.
pass
if re.search(pattern,"/".join(path.split('/')[-1-pattern.count('/'):]),re_flags) is None: if re.search(pattern,"/".join(path.split('/')[-1-pattern.count('/'):]),re_flags) is None:
return False return False
else: else: