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

Diff for /src/usr.bin/patch/pch.c between version 1.56 and 1.57

version 1.56, 2017/03/26 15:28:12 version 1.57, 2017/05/26 20:27:02
Line 254 
Line 254 
         char    *s, *t;          char    *s, *t;
         int     indent, retval;          int     indent, retval;
         struct file_name names[MAX_FILE];          struct file_name names[MAX_FILE];
           int     piece_of_git = 0;
   
         memset(names, 0, sizeof(names));          memset(names, 0, sizeof(names));
         ok_to_create_file = false;          ok_to_create_file = false;
Line 298 
Line 299 
                 if (!stars_last_line && strnEQ(s, "*** ", 4))                  if (!stars_last_line && strnEQ(s, "*** ", 4))
                         names[OLD_FILE].path = fetchname(s + 4,                          names[OLD_FILE].path = fetchname(s + 4,
                             &names[OLD_FILE].exists, strippath);                              &names[OLD_FILE].exists, strippath);
                 else if (strnEQ(s, "--- ", 4))                  else if (strnEQ(s, "--- ", 4)) {
                         names[NEW_FILE].path = fetchname(s + 4,                          size_t off = 4;
                           if (piece_of_git && strippath == 957)
                                   off = 6;
                           names[NEW_FILE].path = fetchname(s + off,
                             &names[NEW_FILE].exists, strippath);                              &names[NEW_FILE].exists, strippath);
                 else if (strnEQ(s, "+++ ", 4))                  } else if (strnEQ(s, "+++ ", 4)) {
                         /* pretend it is the old name */                          /* pretend it is the old name */
                         names[OLD_FILE].path = fetchname(s + 4,                          size_t off = 4;
                           if (piece_of_git && strippath == 957)
                                   off = 6;
                           names[OLD_FILE].path = fetchname(s + off,
                             &names[OLD_FILE].exists, strippath);                              &names[OLD_FILE].exists, strippath);
                 else if (strnEQ(s, "Index:", 6))                  } else if (strnEQ(s, "Index:", 6))
                         names[INDEX_FILE].path = fetchname(s + 6,                          names[INDEX_FILE].path = fetchname(s + 6,
                             &names[INDEX_FILE].exists, strippath);                              &names[INDEX_FILE].exists, strippath);
                 else if (strnEQ(s, "Prereq:", 7)) {                  else if (strnEQ(s, "Prereq:", 7)) {
Line 320 
Line 327 
                                 free(revision);                                  free(revision);
                                 revision = NULL;                                  revision = NULL;
                         }                          }
                 }                  } else if (strnEQ(s, "diff --git ", 11))
                           piece_of_git = 1;
                 if ((!diff_type || diff_type == ED_DIFF) &&                  if ((!diff_type || diff_type == ED_DIFF) &&
                     first_command_line >= 0 &&                      first_command_line >= 0 &&
                     strEQ(s, ".\n")) {                      strEQ(s, ".\n")) {

Legend:
Removed from v.1.56  
changed lines
  Added in v.1.57