You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Patch::error() returns $ERROR
* In Patch::print_rejects(), $ERROR is incremented if rejected pieces are found during processing
* No other function updates $ERROR, so Patch::error() indicates if rejects are present
* die() cals are wrapped by an END-block which sets exit code to 1; follow standard and set it to 2 [1]
* Failure to detect a diff in the input is considered an error; call die() to indicate this
* test1: "perl patch -x" ---> bad option, exit(2)
* test2: "echo "BOGUS-DIFF-123" > bogus.diff && perl patch xargs bogus.diff" ---> no diff found, exit(2)
* test3: "perl patch dirname sort.diff" ---> mismatched diff which can't be applied, exit(1)
* test4: "perl patch a.c correct.diff" ---> diff applies with no failed parts, exit(0)
1. https://pubs.opengroup.org/onlinepubs/007904975/utilities/patch.html
0 commit comments