ReaderUI:setLastDirForFileBrowser(): remove trailing /

Plugins may provide that dir with or without a trailing /.
Not having a trailing / is expected by File browser to
avoid duplicate paths.
This commit is contained in:
poire-z
2020-06-08 21:54:24 +02:00
parent 886b3063e7
commit 9af693f84c

View File

@@ -429,6 +429,9 @@ function ReaderUI:init()
end
function ReaderUI:setLastDirForFileBrowser(dir)
if dir and #dir > 1 and dir:sub(-1) == "/" then
dir = dir:sub(1, -2)
end
self.last_dir_for_file_browser = dir
end