mirror of
https://github.com/powerline/powerline.git
synced 2025-07-21 21:05:11 +02:00
Fix infinite add_watches loop with symbolic links
Added a check to ensure that add_watches doesn't run on the same folder over and over again. This occurs at least when circular symbolic links are present. Fix #543
This commit is contained in:
parent
2758c349db
commit
8de2a9abf9
@ -50,6 +50,10 @@ class INotifyTreeWatcher(INotify):
|
||||
''' Add watches for this directory and all its descendant directories,
|
||||
recursively. '''
|
||||
base = realpath(base)
|
||||
# There may exist a link which leads to an endless
|
||||
# add_watches loop or to maximum recursion depth exceeded
|
||||
if not top_level and base in self.watched_dirs:
|
||||
return
|
||||
try:
|
||||
is_dir = self.add_watch(base)
|
||||
except OSError as e:
|
||||
|
Loading…
x
Reference in New Issue
Block a user