Skip to content

Commit 49b6827

Browse files
committed
Fix file navigation in linux
1 parent 1de86d8 commit 49b6827

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tkfilebrowser/filebrowser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -982,13 +982,13 @@ def _update_path_bar(self, path):
982982
b.destroy()
983983
self.path_bar_buttons = []
984984
if path == "/":
985-
folders = [""]
985+
folders = []
986986
else:
987987
folders = path.split(SEP)
988988
while '' in folders:
989989
folders.remove('')
990990
if OSNAME == 'nt':
991-
p = folders[0] + '\\'
991+
p = folders.pop(0) + '\\'
992992
b = PathButton(self.path_bar, self.path_var, p, text=p,
993993
command=lambda path=p: self.display_folder(path, update_bar=False))
994994
else:
@@ -997,7 +997,7 @@ def _update_path_bar(self, path):
997997
command=lambda path=p: self.display_folder(p, update_bar=False))
998998
self.path_bar_buttons.append(b)
999999
b.grid(row=0, column=1, sticky="ns")
1000-
for i, folder in enumerate(folders[1:]):
1000+
for i, folder in enumerate(folders):
10011001
p = join(p, folder)
10021002
b = PathButton(self.path_bar, self.path_var, p, text=folder,
10031003
command=lambda f=p: self.display_folder(f, update_bar=False),

0 commit comments

Comments
 (0)