[imapfilter-devel] return empty array instead nill

Jan Lana Jan.Lana at Sun.COM
Wed Jan 24 12:54:19 EET 2007


Hi,

fetchfields, fetchheaders, ... functions return 'nil' if the messages
array is empty. Much better is to return empty array '{}' because it
allows constructions like

for i,v in pairs(fetchfields(... match(...))) do

pairs() fails on nil argument, so now I have to store the fetchfields()
result to a variable and test it first.

A simple patch is attached.

regards,
- jenda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: interface.lua.diff
Type: text/x-diff
Size: 1033 bytes
Desc: not available
URL: <http://lists.hellug.gr/pipermail/imapfilter-devel/attachments/20070124/70de7e20/attachment.diff>


More information about the Imapfilter-devel mailing list