wastebasket: Stop infinite loop if .waste is not found.

This commit is contained in:
Ole Tange 2020-01-07 16:25:29 +01:00
parent 4389fb20e5
commit acd02c003d
2 changed files with 7 additions and 1 deletions

View file

@ -26,4 +26,5 @@ install:
mkdir -p /usr/local/share/man/man1
parallel ln -sf `pwd`/{} /usr/local/share/man/man1/{/} ::: */*.1
mkdir -p $(HOME)/.local/share/vlc/lua/extensions
ln -s `pwd`/splitvideo/dotlocal/share/vlc/lua/extensions/splitvideo.lua $(HOME)/.local/share/vlc/lua/extensions/splitvideo.lua
ln -sf `pwd`/splitvideo/dotlocal/share/vlc/lua/extensions/splitvideo.lua $(HOME)/.local/share/vlc/lua/extensions/splitvideo.lua
ln -sf `pwd`/wastebasket/dotlocal/share/vlc/lua/extensions/WasteBasket.lua $(HOME)/.local/share/vlc/lua/extensions/WasteBasket.lua

View file

@ -74,6 +74,11 @@ function wastedir(dir)
end
-- try the parent dir
local parent = dirname(dir)
if(parent == dir) then
-- we have reached root (/)
-- return wdir (which does not exist)
return wdir
end
vlc.msg.dbg("[Wastebasket/wastedir] parent " .. parent)
if directory_exists(parent) then
return wastedir(parent)