If you face an error like:
patching file xx
Assertion failed: (s && size), function savebuf, file /SourceCache/gpatch/gpatch-3/patch/util.c, line 424.
Abort trap: 6
Because the version of GNU Patch that bundles Mac OS is 6 years old, it has some bugs that were solved later. To fix it you just have to:
- Download latest stable version from http://ftp.gnu.org/gnu/patch/
- Untar it
- Open terminal and access the directory of the uncompressed archive
- Execute "./configure && make && make install"
- You are done! Latest version will be located at /usr/local/bin. Just reopen the terminal and you'll have the latest version.