Home may be None, respect it

This commit is contained in:
ZyX 2014-02-09 01:16:29 +04:00
parent 173159aea4
commit 4e35007486

View File

@ -101,8 +101,9 @@ def cwd(pl, segment_info, dir_shorten_len=None, dir_limit_depth=None, use_path_s
cwd = "[not found]"
else:
raise
home = u(segment_info['home'])
home = segment_info['home']
if home:
home = u(home)
cwd = re.sub('^' + re.escape(home), '~', cwd, 1)
cwd_split = cwd.split(os.sep)
cwd_split_len = len(cwd_split)