Gerber X2 patch (Support for the "file function" attribute) from Thiadmer Riemersma, committed in rev 4948: minor fix for better compatibility with older versions of Pcbnew