Thanks for the patch.
btw, how was the patch produced ? it is neither plain diff, nor unified diff format...
forgot breaks in the case statements and apparently diff format was messed up
Available in the development branch svn://svn.zabbix.com/branches/dev/ZBX-6040
Tested, works as expected.
Available in versions pre-2.0.5 r32478 and pre-2.1.0 r32479.