diff -C2 -N patch-2.0.12u4/ChangeLog patch-2.0.12u5/ChangeLog *** patch-2.0.12u4/ChangeLog Thu Jun 27 13:05:56 1991 --- patch-2.0.12u5/ChangeLog Tue Dec 3 12:09:49 1991 *************** *** 1,2 **** --- 1,33 ---- + Tue Dec 3 11:27:16 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * patchlevel.h: PATCHLEVEL 12u5. + + * Makefile.SH: Change clean, distclean, and realclean targets a + little so they agree with the GNU coding standards. + Add Makefile to addedbyconf, so distclean removes it. + + * Configure: Recognize Domain/OS C library in /lib/libc. + From mmuegel@mot.com (Michael S. Muegel). + + * pch.c: Fixes from Wayne Davison: + Patch now accepts no-context context diffs that are + specified with an assumed one line hunk (e.g. "*** 10 ****"). + Fixed a bug in both context and unified diff processing that would + put a zero-context hunk in the wrong place (one line too soon). + Fixed a minor problem with p_max in unified diffs where it would + set p_max to hunkmax unnecessarily (the only adverse effect was to + not supply empty lines at eof by assuming they were truncated). + + Tue Jul 2 03:25:51 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) + + * Configure: Check for signal declaration in + /usr/include/sys/signal.h as well as /usr/include/signal.h. + + * Configure, common.h, config.h.SH: Comment out the sprintf + declaration and tests to determine its return value type. It + conflicts with ANSI C systems' prototypes in stdio.h and the + return value of sprintf is never used anyway -- it's always cast + to void. + Thu Jun 27 13:05:32 1991 David J. MacKenzie (djm at churchy.gnu.ai.mit.edu) diff -C2 -N patch-2.0.12u4/Configure patch-2.0.12u5/Configure *** patch-2.0.12u4/Configure Sun Dec 2 23:46:47 1990 --- patch-2.0.12u5/Configure Tue Dec 3 11:32:58 1991 *************** *** 422,440 **** libc=/lib/libc.a else ! ans=`loc libc.a blurfl/dyick $libpth` ! if test ! -f $ans; then ! ans=`loc clib blurfl/dyick $libpth` ! fi ! if test ! -f $ans; then ! ans=`loc libc blurfl/dyick $libpth` ! fi ! if test -f $ans; then ! echo "Your C library is in $ans, of all places." ! libc=$ans else ! if test -f "$libc"; then ! echo "Your C library is in $libc, like you said before." ! else ! cat <.ucbsprf.c <<'EOF' ! main() { char buf[10]; exit((unsigned long)sprintf(buf,"%s","foo") > 10L); } ! EOF ! if cc .ucbsprf.c -o .ucbsprf >/dev/null 2>&1 && .ucbsprf; then ! echo "Your sprintf() returns (int)." ! d_charsprf="$undef" ! else ! echo "Your sprintf() returns (char*)." ! d_charsprf="$define" ! fi ! /bin/rm -f .ucbsprf.c .ucbsprf : see if we can have long filenames --- 601,617 ---- rm -f try today ! #: see if sprintf is declared as int or pointer to char ! #echo " " ! #cat >.ucbsprf.c <<'EOF' ! #main() { char buf[10]; exit((unsigned long)sprintf(buf,"%s","foo") > 10L); } ! #EOF ! #if cc .ucbsprf.c -o .ucbsprf >/dev/null 2>&1 && .ucbsprf; then ! # echo "Your sprintf() returns (int)." ! # d_charsprf="$undef" ! #else ! # echo "Your sprintf() returns (char*)." ! # d_charsprf="$define" ! #fi ! #/bin/rm -f .ucbsprf.c .ucbsprf : see if we can have long filenames *************** *** 659,663 **** : see if signal is declared as pointer to function returning int or void echo " " ! if $contains 'void.*signal' /usr/include/signal.h >/dev/null 2>&1 ; then echo "You have void (*signal())() instead of int." d_voidsig="$define" --- 664,669 ---- : see if signal is declared as pointer to function returning int or void echo " " ! if $contains 'void.*signal' /usr/include/signal.h >/dev/null 2>&1 || ! $contains 'void.*signal' /usr/include/sys/signal.h >/dev/null 2>&1 ; then echo "You have void (*signal())() instead of int." d_voidsig="$define" diff -C2 -N patch-2.0.12u4/Makedist patch-2.0.12u5/Makedist *** patch-2.0.12u4/Makedist Thu Jun 27 13:11:46 1991 --- patch-2.0.12u5/Makedist Tue Dec 3 12:04:10 1991 *************** *** 4,8 **** files='ChangeLog Configure EXTERN.h INTERN.h MANIFEST Makedist Makefile.SH README common.h config.H config.h.SH inp.c inp.h malloc.c patch.c patch.man patchlevel.h pch.c pch.h util.c util.h version.c version.h' ! distdir=patch-2.0.12u4 mkdir $distdir && --- 4,8 ---- files='ChangeLog Configure EXTERN.h INTERN.h MANIFEST Makedist Makefile.SH README common.h config.H config.h.SH inp.c inp.h malloc.c patch.c patch.man patchlevel.h pch.c pch.h util.c util.h version.c version.h' ! distdir=patch-2.0.12u5 mkdir $distdir && diff -C2 -N patch-2.0.12u4/Makefile.SH patch-2.0.12u5/Makefile.SH *** patch-2.0.12u4/Makefile.SH Sun Jan 20 21:04:52 1991 --- patch-2.0.12u5/Makefile.SH Tue Dec 3 12:09:24 1991 *************** *** 46,50 **** lintflags = -phbvxac ! addedbyconf = Makefile.old bsd config.h config.sh eunice loc pdp11 usg v7 # grrr --- 46,50 ---- lintflags = -phbvxac ! addedbyconf = Makefile Makefile.old bsd config.h config.sh eunice loc pdp11 usg v7 # grrr *************** *** 77,84 **** clean: ! rm -f *.o *.orig core ! realclean: ! rm -f patch *.o *.orig *~ core $(addedbyconf) # The following lint has practically everything turned on. Unfortunately, --- 77,87 ---- clean: ! rm -f patch *.o core ! distclean: clean ! rm -f $(addedbyconf) ! ! realclean: distclean ! rm -f *.orig *~ # The following lint has practically everything turned on. Unfortunately, diff -C2 -N patch-2.0.12u4/README patch-2.0.12u5/README *** patch-2.0.12u4/README Wed Aug 15 01:13:31 1990 --- patch-2.0.12u5/README Tue Dec 3 11:48:43 1991 *************** *** 1,2 **** --- 1,13 ---- + Note: This version of patch contains modifications made by the Free + Software Foundation, summarized in the file ChangeLog. Primarily they + are to support the unified context diff format that GNU diff can + produce, but they also include some fixes for other bugs. The FSF is + distributing this version of patch itself because, as of this writing, + Larry has not released a new version of patch since mid-1988. I have + heard that he has been too busy working on other things, like Perl. + Please send bug reports for this version of patch to + bug-gnu-utils@prep.ai.mit.edu as well as to Larry. + --djm@gnu.ai.mit.edu (David MacKenzie) + Patch Kit, Version 2.0 *************** *** 47,51 **** 6) IMPORTANT! Help save the world! Communicate any problems and ! suggested patches to me, lwall@jpl-devvax.Jpl.Nasa.Gov (Larry Wall), so we can keep the world in sync. If you have a problem, there's someone else out there who either has had or will have the same problem. --- 58,62 ---- 6) IMPORTANT! Help save the world! Communicate any problems and ! suggested patches to me, lwall@netlabs.com (Larry Wall), so we can keep the world in sync. If you have a problem, there's someone else out there who either has had or will have the same problem. diff -C2 -N patch-2.0.12u4/common.h patch-2.0.12u5/common.h *** patch-2.0.12u4/common.h Sun Dec 2 23:18:09 1990 --- patch-2.0.12u5/common.h Tue Jul 2 03:24:49 1991 *************** *** 154,157 **** --- 154,158 ---- long lseek(); char *mktemp(); + #if 0 #ifdef CHARSPRINTF char *sprintf(); *************** *** 158,161 **** --- 159,163 ---- #else int sprintf(); + #endif #endif char *getenv(); diff -C2 -N patch-2.0.12u4/config.h.SH patch-2.0.12u5/config.h.SH *** patch-2.0.12u4/config.h.SH Wed Aug 15 01:13:38 1990 --- patch-2.0.12u5/config.h.SH Tue Jul 2 03:25:48 1991 *************** *** 58,62 **** * symbol. */ ! #$d_charsprf CHARSPRINTF /**/ /* FLEXFILENAMES: --- 58,62 ---- * symbol. */ ! /* #$d_charsprf CHARSPRINTF /**/ /* FLEXFILENAMES: diff -C2 -N patch-2.0.12u4/patchlevel.h patch-2.0.12u5/patchlevel.h *** patch-2.0.12u4/patchlevel.h Thu Jun 27 13:05:37 1991 --- patch-2.0.12u5/patchlevel.h Tue Dec 3 12:04:00 1991 *************** *** 1 **** ! #define PATCHLEVEL "12u4" --- 1 ---- ! #define PATCHLEVEL "12u5" diff -C2 -N patch-2.0.12u4/pch.c patch-2.0.12u5/pch.c *** patch-2.0.12u4/pch.c Thu Feb 21 15:03:46 1991 --- patch-2.0.12u5/pch.c Tue Dec 3 11:27:06 1991 *************** *** 612,616 **** while (p_max >= hunkmax) grow_hunkmax(); ! if (p_repl_lines != ptrn_copiable) repl_could_be_missing = FALSE; break; --- 612,617 ---- while (p_max >= hunkmax) grow_hunkmax(); ! if (p_repl_lines != ptrn_copiable ! && (p_context != 0 || p_repl_lines != 1)) repl_could_be_missing = FALSE; break; *************** *** 627,631 **** goto hunk_done; } ! if (context > 0) { if (context < p_context) p_context = context; --- 628,632 ---- goto hunk_done; } ! if (context >= 0) { if (context < p_context) p_context = context; *************** *** 701,704 **** --- 702,709 ---- /* redundant 'new' context lines were omitted - set */ /* up to fill them in from the old file context */ + if (!p_context && p_repl_lines == 1) { + p_repl_lines = 0; + p_max--; + } fillsrc = 1; filldst = repl_beginning+1; *************** *** 706,709 **** --- 711,729 ---- p_end = p_max; } + else if (!p_context && fillcnt == 1) { + /* the first hunk was a null hunk with no context */ + /* and we were expecting one line -- fix it up. */ + while (filldst < p_end) { + p_line[filldst] = p_line[filldst+1]; + p_char[filldst] = p_char[filldst+1]; + p_len[filldst] = p_len[filldst+1]; + filldst++; + } + /* repl_beginning--; /* this doesn't need to be fixed */ + p_end--; + p_first++; /* do append rather than insert */ + fillcnt = 0; + p_ptrn_lines = 0; + } if (diff_type == CONTEXT_DIFF && *************** *** 780,789 **** if (*s != '@') malformed (); ! if (!p_first && !p_ptrn_lines) ! p_first = 1; p_max = p_ptrn_lines + p_repl_lines + 1; while (p_max >= hunkmax) grow_hunkmax(); - p_max = hunkmax; fillsrc = 1; filldst = fillsrc + p_ptrn_lines; --- 800,808 ---- if (*s != '@') malformed (); ! if (!p_ptrn_lines) ! p_first++; /* do append rather than insert */ p_max = p_ptrn_lines + p_repl_lines + 1; while (p_max >= hunkmax) grow_hunkmax(); fillsrc = 1; filldst = fillsrc + p_ptrn_lines;