History log of /freebsd-10-stable/usr.bin/patch/patch.c
Revision Date Author Comments
# 276807 08-Jan-2015 pfg

MFC r276218:

patch: Bring in xstrdup and use it when appropriate.

The function savestr allows NULL return values during Plan A patching so in
case of out of memory conditions, Plan B can step in. In many cases, NULL
value is not properly handled, so use xstrdup here (it's outside Plan A/B
patching, which means that even Plan B relies on successful operations).

Clean up some whitespaces while here

Obtained from: OpenBSD


# 276706 05-Jan-2015 pfg

MFC r276472:

Minor fixes to exit status.

Exit with EXIT_FAILURE for invalid arguments.
Fixes NetBSD-PR 43517.

Print version string to stdout instead of stderr;
it is user-requested and not an error.

Obtained from: NetBSD


# 275840 16-Dec-2014 pfg

MFC r275531, r275581, r275582;

patch(1): Small changes to sync with OpenBSD

Update OpenBSD CVS revision tag for our r255232.
Prefer setvbuf() to setlinebuf().
Small space changes, mostly to keep in sync with OpenBSD

Obtained from: OpenBSD


# 267747 22-Jun-2014 pfg

MFC r267512:

patch: add dry-run alias for compatibility with other implementations.

Other implementations of patch(1), including GNU patch and "svn patch"
have a --dry-run option which does the same as our -C or --check
option.

Add a new alias to make our implementation more compatible.


# 267746 22-Jun-2014 pfg

MFC r267490:
patch: unsign the line length to avoid overflows.

Patch(1) uses a short int for the line length, which is usually
sufficient for regular diffs, but makes no effort to signal
when there is an overflow.

Change the line length to an unsigned short int to better use
the fact that a length is never negative. The change is loosely
inspired on a related change in DragonFly, but we avoid spending
more memory than necessary.

While here adjust the messages to be clearer on what is happening.


# 276807 08-Jan-2015 pfg

MFC r276218:

patch: Bring in xstrdup and use it when appropriate.

The function savestr allows NULL return values during Plan A patching so in
case of out of memory conditions, Plan B can step in. In many cases, NULL
value is not properly handled, so use xstrdup here (it's outside Plan A/B
patching, which means that even Plan B relies on successful operations).

Clean up some whitespaces while here

Obtained from: OpenBSD


# 276706 05-Jan-2015 pfg

MFC r276472:

Minor fixes to exit status.

Exit with EXIT_FAILURE for invalid arguments.
Fixes NetBSD-PR 43517.

Print version string to stdout instead of stderr;
it is user-requested and not an error.

Obtained from: NetBSD


# 275840 16-Dec-2014 pfg

MFC r275531, r275581, r275582;

patch(1): Small changes to sync with OpenBSD

Update OpenBSD CVS revision tag for our r255232.
Prefer setvbuf() to setlinebuf().
Small space changes, mostly to keep in sync with OpenBSD

Obtained from: OpenBSD


# 267747 22-Jun-2014 pfg

MFC r267512:

patch: add dry-run alias for compatibility with other implementations.

Other implementations of patch(1), including GNU patch and "svn patch"
have a --dry-run option which does the same as our -C or --check
option.

Add a new alias to make our implementation more compatible.


# 267746 22-Jun-2014 pfg

MFC r267490:
patch: unsign the line length to avoid overflows.

Patch(1) uses a short int for the line length, which is usually
sufficient for regular diffs, but makes no effort to signal
when there is an overflow.

Change the line length to an unsigned short int to better use
the fact that a length is never negative. The change is loosely
inspired on a related change in DragonFly, but we avoid spending
more memory than necessary.

While here adjust the messages to be clearer on what is happening.