hooks/patches: fix parsing .{diff,patch} name