Clean up code in inifile.c
Merge pull request #3354 from yebblies/inifile

[cleanup] Untangle the rat's nest in inifile.c