[BACK]Return to patch.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / patch

Diff for /src/usr.bin/patch/patch.c between version 1.69 and 1.70

version 1.69, 2019/12/02 22:17:32 version 1.70, 2022/08/03 07:25:44
Line 260 
Line 260 
                         if (!skip_rest_of_patch) {                          if (!skip_rest_of_patch) {
                                 do {                                  do {
                                         where = locate_hunk(fuzz);                                          where = locate_hunk(fuzz);
                                         if (hunk == 1 && where == 0 && !force) {                                          if ((hunk == 1 && where == 0 && !force) ||
                                               (where == 1 && pch_ptrn_lines() == 0 && !force)) {
                                                 /* dwim for reversed patch? */                                                  /* dwim for reversed patch? */
                                                 if (!pch_swap()) {                                                  if (!pch_swap()) {
                                                         if (fuzz == 0)                                                          if (fuzz == 0)
Line 276 
Line 277 
                                                                 /* put it back to normal */                                                                  /* put it back to normal */
                                                                 fatal("lost hunk on alloc error!\n");                                                                  fatal("lost hunk on alloc error!\n");
                                                         reverse = !reverse;                                                          reverse = !reverse;
   
                                                           /* restore position if this patch creates a file */
                                                           if (pch_ptrn_lines() == 0)
                                                                   where = 1;
                                                 } else if (noreverse) {                                                  } else if (noreverse) {
                                                         if (!pch_swap())                                                          if (!pch_swap())
                                                                 /* put it back to normal */                                                                  /* put it back to normal */

Legend:
Removed from v.1.69  
changed lines
  Added in v.1.70