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

Diff for /src/usr.bin/cvs/diff3.c between version 1.1 and 1.2

version 1.1, 2005/10/22 17:32:57 version 1.2, 2005/10/23 03:47:12
Line 127 
Line 127 
  */   */
 static struct diff *de;  static struct diff *de;
 static char *overlap;  static char *overlap;
 static int overlapcnt;  static int overlapcnt = 0;
 static FILE *fp[3];  static FILE *fp[3];
 static int cline[3];            /* # of the last-read line in each file (0-2) */  static int cline[3];            /* # of the last-read line in each file (0-2) */
   
Line 328 
Line 328 
                                 return (-1);                                  return (-1);
                 } else if (op == 'c') {                  } else if (op == 'c') {
                         if ((start > dlines->l_nblines) ||                          if ((start > dlines->l_nblines) ||
                             (start < 0) || (*ep != ','))                              (start < 0) || ((*ep != ',') && (*ep != 'c')))
                                 return (-1);                                  return (-1);
   
                         ep++;                          if (*ep == ',') {
                         end = (int)strtol(ep, &ep, 10);                                  ep++;
                         if ((end < 0) || (*ep != 'c'))                                  end = (int)strtol(ep, &ep, 10);
                                 return (-1);                                  if ((end < 0) || (*ep != 'c'))
                                           return (-1);
                           } else {
                                   end = start;
                           }
                 }                  }
   
   
                 for (;;) {                  for (;;) {
                         if (dlp == NULL)                          if (dlp == NULL)
                                 break;                                  break;
Line 355 
Line 360 
                 if (dlp == NULL)                  if (dlp == NULL)
                         return (-1);                          return (-1);
   
   
                 if (op == 'c') {                  if (op == 'c') {
                         for (i = start; i <= end; i++) {                          for (i = 0; i <= (end - start); i++) {
                                 ndlp = TAILQ_NEXT(dlp, l_list);                                  ndlp = TAILQ_NEXT(dlp, l_list);
                                 TAILQ_REMOVE(&(dlines->l_lines), dlp, l_list);                                  TAILQ_REMOVE(&(dlines->l_lines), dlp, l_list);
                                 dlp = ndlp;                                  dlp = ndlp;
                         }                          }
                           dlp = TAILQ_PREV(dlp, cvs_tqh, l_list);
                 }                  }
   
                 if (op == 'a' || op == 'c') {                  if (op == 'a' || op == 'c') {
Line 747 
Line 754 
 edscript(int n)  edscript(int n)
 {  {
         int j, k;          int j, k;
         char block[BUFSIZ];          char block[BUFSIZ+1];
   
         for (n = n; n > 0; n--) {          for (n = n; n > 0; n--) {
                 if (!oflag || !overlap[n])                  if (!oflag || !overlap[n])
Line 762 
Line 769 
                         block[j] = '\0';                          block[j] = '\0';
                         diff_output("%s", block);                          diff_output("%s", block);
                 }                  }
   
                 if (!oflag || !overlap[n])                  if (!oflag || !overlap[n])
                         diff_output(".\n");                          diff_output(".\n");
                 else {                  else {

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2