From b0a04bff8e48f5a7233e967b67b60b6e3e5e0792 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 28 Oct 2016 07:15:46 +0200 Subject: [PATCH] Use OS-independent path separators --- qutebrowser/mainwindow/prompt.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qutebrowser/mainwindow/prompt.py b/qutebrowser/mainwindow/prompt.py index 5a28bb03a..d0d807d26 100644 --- a/qutebrowser/mainwindow/prompt.py +++ b/qutebrowser/mainwindow/prompt.py @@ -529,9 +529,13 @@ class FilenamePrompt(_BasePrompt): @pyqtSlot(str) def _set_fileview_root(self, path): """Set the root path for the file display.""" - if not path.endswith('/') or path == '/': + separators = os.sep + if os.altsep is not None: + separators += os.altsep + + if path == '/' or (path and path[-1] not in separators): return - path.rstrip('/') + path.rstrip(separators) try: if os.path.isdir(path):