From 019c4302ad86fd6981e8abc90cd8cb58003b662c Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Sun, 8 Dec 2024 22:36:02 +0100 Subject: Handle tiny files gracefully Lua detection functions used to cause fatal errors on failure to read. We could also reconsider treating detection errors as fatal. --- plugins/xcursor.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/xcursor.lua') diff --git a/plugins/xcursor.lua b/plugins/xcursor.lua index 740736f..3350d34 100644 --- a/plugins/xcursor.lua +++ b/plugins/xcursor.lua @@ -16,7 +16,7 @@ -- local detect = function (c) - return c:read (4) == "Xcur" + return #c >= 4 and c:read (4) == "Xcur" end -- https://www.x.org/releases/current/doc/man/man3/Xcursor.3.xhtml -- cgit v1.2.3-70-g09d2