patch(1): sync with FreeBSD to version 2.0-12u11 Summary of notable changes from previous sync: - add -Vnone option to disable backup files - avoid infinite loop asking for a filename - add support for git generated diffs - don't overrun line buffer in some cases - fix the file removal test - give /dev/null patches special treatment
patch - Remove RCS and SCCS auto-checkout support * Remove stale RCS and SCCS support which involves the patch(1) program constructing a system() command using filename data supplied from the file. DragonFly deems this to be too dangerous, quoted or not. Security: CVE-2015-1416 Reported-by: Xin Li, Martin Natano
patch(1): Sync with FreeBSD FreeBSD has taken our patch(1) completely (29 JAN 2013), forked it, and has improved on it. It's a relatively simple sync. Selected change log: More user friendly: - Ask only once for "apply anyway" - Tell user which patch failed rather than only # of hunk failures Handle lines with null character: - read buffer for pgets properly populated - callers of pgets still misprocess buffer contents, but at least pgets is more accurate Make "patch < fubar" and "patch -i fubar" equivalent: - previous behavior was source of "unexpected end of file in patch" errors when null characters came from stdin Fixed error handling where final fclose got skipped Fixed target selection logic to match was was documented on man page Synced with OpenBSD base
- Take back the commit from Oct. 1, 2004 since FreeBSD has changed their Mk/bsd.port.mk in the meantime to use the --suffix option. - Sync with OpenBSD, which means the reject file is written in unified format now if the original diff was unified. - Perform some minor cleanup.
Make the BSD patch WARNS=6 clean - constify string operations if possible - rename some variables to avoid namespace clashes - don't cast the signal functions to sig_t), it's unnecessary Submitted-by: Sascha Wildner <saw@online.de> Instead of i_ptr[++iline][0] = '\0', I've used a special empty char array instead. I'm not sure if i_ptr[++iline] points to a valid memory location under all circumstances and this is a safer bet.