patch files using diff output