From 4925111afdc17fe70e3aa47fbeebac496d29be1f Mon Sep 17 00:00:00 2001 From: AardCrowley Date: Mon, 29 Apr 2024 15:33:11 -0400 Subject: [PATCH] Bug fix Fixed bug where keys wouldn't show up if flags were empty. --- Keycheck.xml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Keycheck.xml b/Keycheck.xml index 1061c5c..4223340 100644 --- a/Keycheck.xml +++ b/Keycheck.xml @@ -131,14 +131,12 @@ end function processKey(name, line, wildcards) if line == "{/keyring}" then keyEnd() return end - local parts= {} - keyNameLen = 0 - for part in line:gmatch("([^,]+)") do - table.insert(parts, part) - end + local keyID, keyName, keyExpiry = line:match("^(%d+),[^,]*,(.-),[^,]+,[^,]+,[^,]+,[^,]+,(.*)$") + + keyExpiry = tonumber(keyExpiry) - local keyID, keyName, keyExpiry = tonumber(parts[1]), table.concat(parts, ",", 3, #parts-5), (parts[#parts] == "-1" and 0 or tonumber(parts[#parts])) + if keyExpiry == -1 then keyExpiry = 0 end if keyExpiry > 0 then table.insert(keyringList, {keyID = keyID, keyName = keyName, keyExpiry = keyExpiry})