=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/patch/pch.c,v retrieving revision 1.25 retrieving revision 1.26 diff -c -r1.25 -r1.26 *** src/usr.bin/patch/pch.c 2003/07/28 18:35:36 1.25 --- src/usr.bin/patch/pch.c 2003/07/28 19:15:34 1.26 *************** *** 1,7 **** ! /* $OpenBSD: pch.c,v 1.25 2003/07/28 18:35:36 otto Exp $ */ #ifndef lint ! static const char rcsid[] = "$OpenBSD: pch.c,v 1.25 2003/07/28 18:35:36 otto Exp $"; #endif /* not lint */ #include --- 1,7 ---- ! /* $OpenBSD: pch.c,v 1.26 2003/07/28 19:15:34 deraadt Exp $ */ #ifndef lint ! static const char rcsid[] = "$OpenBSD: pch.c,v 1.26 2003/07/28 19:15:34 deraadt Exp $"; #endif /* not lint */ #include *************** *** 256,263 **** else if (strnEQ(s, "--- ", 4)) newtmp = savestr(s + 4); else if (strnEQ(s, "+++ ", 4)) ! oldtmp = savestr(s + 4); /* pretend it is the old ! * name */ else if (strnEQ(s, "Index:", 6)) indtmp = savestr(s + 6); else if (strnEQ(s, "Prereq:", 7)) { --- 256,262 ---- else if (strnEQ(s, "--- ", 4)) newtmp = savestr(s + 4); else if (strnEQ(s, "+++ ", 4)) ! oldtmp = savestr(s + 4); /* pretend it is the old name */ else if (strnEQ(s, "Index:", 6)) indtmp = savestr(s + 6); else if (strnEQ(s, "Prereq:", 7)) { *************** *** 549,556 **** p_ptrn_lines = 0; p_first = 1; } ! p_max = p_ptrn_lines + 6; /* we need this much at ! * least */ while (p_max >= hunkmax) grow_hunkmax(); p_max = hunkmax; --- 548,556 ---- p_ptrn_lines = 0; p_first = 1; } ! ! /* we need this much at least */ ! p_max = p_ptrn_lines + 6; while (p_max >= hunkmax) grow_hunkmax(); p_max = hunkmax; *************** *** 742,749 **** filldst++; } #if 0 ! repl_beginning--; /* this doesn't need to be ! * fixed */ #endif p_end--; p_first++; /* do append rather than insert */ --- 742,748 ---- filldst++; } #if 0 ! repl_beginning--; /* this doesn't need to be fixed */ #endif p_end--; p_first++; /* do append rather than insert */ *************** *** 761,768 **** } /* if there were omitted context lines, fill them in now */ if (fillcnt) { ! p_bfake = filldst; /* remember where not to ! * free() */ p_efake = filldst + fillcnt - 1; while (fillcnt-- > 0) { while (fillsrc <= p_end && p_char[fillsrc] != ' ') --- 760,766 ---- } /* if there were omitted context lines, fill them in now */ if (fillcnt) { ! p_bfake = filldst; /* remember where not to free() */ p_efake = filldst + fillcnt - 1; while (fillcnt-- > 0) { while (fillsrc <= p_end && p_char[fillsrc] != ' ') *************** *** 843,849 **** filldst = fillsrc + p_ptrn_lines; p_end = filldst + p_repl_lines; snprintf(buf, sizeof buf, "*** %ld,%ld ****\n", p_first, ! p_first + p_ptrn_lines - 1); p_line[0] = savestr(buf); if (out_of_mem) { p_end = -1; --- 841,847 ---- filldst = fillsrc + p_ptrn_lines; p_end = filldst + p_repl_lines; snprintf(buf, sizeof buf, "*** %ld,%ld ****\n", p_first, ! p_first + p_ptrn_lines - 1); p_line[0] = savestr(buf); if (out_of_mem) { p_end = -1; *************** *** 851,857 **** } p_char[0] = '*'; snprintf(buf, sizeof buf, "--- %ld,%ld ----\n", p_newfirst, ! p_newfirst + p_repl_lines - 1); p_line[filldst] = savestr(buf); if (out_of_mem) { p_end = 0; --- 849,855 ---- } p_char[0] = '*'; snprintf(buf, sizeof buf, "--- %ld,%ld ----\n", p_newfirst, ! p_newfirst + p_repl_lines - 1); p_line[filldst] = savestr(buf); if (out_of_mem) { p_end = 0; *************** *** 997,1003 **** p_newfirst = min; p_repl_lines = max - min + 1; snprintf(buf, sizeof buf, "*** %ld,%ld\n", p_first, ! p_first + p_ptrn_lines - 1); p_line[0] = savestr(buf); if (out_of_mem) { p_end = -1; --- 995,1001 ---- p_newfirst = min; p_repl_lines = max - min + 1; snprintf(buf, sizeof buf, "*** %ld,%ld\n", p_first, ! p_first + p_ptrn_lines - 1); p_line[0] = savestr(buf); if (out_of_mem) { p_end = -1;