[vlc-devel] [PATCH] avoid crash where vlc.net.stat returns nil for a file (such as alias on mac os)

Rémi Denis-Courmont remi at remlab.net
Mon Feb 27 15:45:52 CET 2012


   Hello,

If stat fails, the file does not exist (or is a link to a non-existent or 
unreachable file). I am not sure pretending it exists with an unknown type is 
all that good an idea...

On Friday 24 February 2012, Rob Jonson wrote:
> ---
>  share/lua/intf/modules/httprequests.lua |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/share/lua/intf/modules/httprequests.lua
> b/share/lua/intf/modules/httprequests.lua index 262f618..9dcec8d 100644
> --- a/share/lua/intf/modules/httprequests.lua
> +++ b/share/lua/intf/modules/httprequests.lua
> @@ -396,8 +396,12 @@ getbrowsetable = function ()
>                  local path, name =  df, f
>                  local element={}
> 
> -                for k,v in pairs(s) do
> -                    element[k]=v
> +				if (s) then
> +                	for k,v in pairs(s) do
> +                    	element[k]=v
> +                	end
> +                else
> +                    element["type"]="unknown"
>                  end
>                  element["path"]=path
>                  element["name"]=name
-- 
Rémi Denis-Courmont
http://www.remlab.info



More information about the vlc-devel mailing list