=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/patch/patch.c,v retrieving revision 1.46 retrieving revision 1.47 diff -c -r1.46 -r1.47 *** src/usr.bin/patch/patch.c 2008/08/20 18:28:46 1.46 --- src/usr.bin/patch/patch.c 2009/04/05 13:36:00 1.47 *************** *** 1,4 **** ! /* $OpenBSD: patch.c,v 1.46 2008/08/20 18:28:46 otto Exp $ */ /* * patch - a program to apply diffs to original files --- 1,4 ---- ! /* $OpenBSD: patch.c,v 1.47 2009/04/05 13:36:00 stsp Exp $ */ /* * patch - a program to apply diffs to original files *************** *** 27,33 **** */ #ifndef lint ! static const char rcsid[] = "$OpenBSD: patch.c,v 1.46 2008/08/20 18:28:46 otto Exp $"; #endif /* not lint */ #include --- 27,33 ---- */ #ifndef lint ! static const char rcsid[] = "$OpenBSD: patch.c,v 1.47 2009/04/05 13:36:00 stsp Exp $"; #endif /* not lint */ #include *************** *** 149,154 **** --- 149,155 ---- main(int argc, char *argv[]) { int error = 0, hunk, failed, i, fd; + bool patch_seen; LINENUM where = 0, newwhere, fuzz, mymaxfuzz; const char *tmpdir; char *v; *************** *** 208,216 **** --- 209,220 ---- /* make sure we clean up /tmp in case of disaster */ set_signals(0); + patch_seen = false; for (open_patch_file(filearg[1]); there_is_another_patch(); reinitialize_almost_everything()) { /* for each patch in patch file */ + + patch_seen = true; warn_on_invalid_line = true; *************** *** 397,402 **** --- 401,410 ---- } set_signals(1); } + + if (!patch_seen) + error = 2; + my_exit(error); /* NOTREACHED */ }