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

Diff for /src/usr.bin/diff/diffreg.c between version 1.64 and 1.65

version 1.64, 2006/02/22 07:26:08 version 1.65, 2007/02/22 01:44:36
Line 201 
Line 201 
 static int lastmatchline;  static int lastmatchline;
   
 static FILE *opentemp(const char *);  static FILE *opentemp(const char *);
 static void output(char *, FILE *, char *, FILE *);  static void output(char *, FILE *, char *, FILE *, int);
 static void check(char *, FILE *, char *, FILE *);  static void check(char *, FILE *, char *, FILE *);
 static void range(int, int, char *);  static void range(int, int, char *);
 static void uni_range(int, int);  static void uni_range(int, int);
Line 212 
Line 212 
 static void equiv(struct line *, int, struct line *, int, int *);  static void equiv(struct line *, int, struct line *, int, int *);
 static void unravel(int);  static void unravel(int);
 static void unsort(struct line *, int, int *);  static void unsort(struct line *, int, int *);
 static void change(char *, FILE *, char *, FILE *, int, int, int, int);  static void change(char *, FILE *, char *, FILE *, int, int, int, int, int);
 static void sort(struct line *, int);  static void sort(struct line *, int);
 static void print_header(const char *, const char *);  static void print_header(const char *, const char *);
 static int  ignoreline(char *);  static int  ignoreline(char *);
Line 405 
Line 405 
                         rewind(stdout);                          rewind(stdout);
                         free(header);                          free(header);
                 }                  }
         } else if (flags & D_HEADER)          }
                 printf("%s %s %s\n", diffargs, file1, file2);  
         prepare(0, f1, stb1.st_size);          prepare(0, f1, stb1.st_size);
         prepare(1, f2, stb2.st_size);          prepare(1, f2, stb2.st_size);
         prune();          prune();
Line 437 
Line 436 
         ixold = erealloc(ixold, (len[0] + 2) * sizeof(long));          ixold = erealloc(ixold, (len[0] + 2) * sizeof(long));
         ixnew = erealloc(ixnew, (len[1] + 2) * sizeof(long));          ixnew = erealloc(ixnew, (len[1] + 2) * sizeof(long));
         check(file1, f1, file2, f2);          check(file1, f1, file2, f2);
         output(file1, f1, file2, f2);          output(file1, f1, file2, f2, (flags & D_HEADER));
         if (ostdout != -1) {          if (ostdout != -1) {
                 int wstatus;                  int wstatus;
   
Line 898 
Line 897 
 }  }
   
 static void  static void
 output(char *file1, FILE *f1, char *file2, FILE *f2)  output(char *file1, FILE *f1, char *file2, FILE *f2, int flags)
 {  {
         int m, i0, i1, j0, j1;          int m, i0, i1, j0, j1;
   
Line 917 
Line 916 
                                 i1++;                                  i1++;
                         j1 = J[i1 + 1] - 1;                          j1 = J[i1 + 1] - 1;
                         J[i1] = j1;                          J[i1] = j1;
                         change(file1, f1, file2, f2, i0, i1, j0, j1);                          change(file1, f1, file2, f2, i0, i1, j0, j1, flags);
                 }                  }
         } else {          } else {
                 for (i0 = m; i0 >= 1; i0 = i1 - 1) {                  for (i0 = m; i0 >= 1; i0 = i1 - 1) {
Line 929 
Line 928 
                                 i1--;                                  i1--;
                         j1 = J[i1 - 1] + 1;                          j1 = J[i1 - 1] + 1;
                         J[i1] = j1;                          J[i1] = j1;
                         change(file1, f1, file2, f2, i1, i0, j1, j0);                          change(file1, f1, file2, f2, i1, i0, j1, j0, flags);
                 }                  }
         }          }
         if (m == 0)          if (m == 0)
                 change(file1, f1, file2, f2, 1, 0, 1, len[1]);                  change(file1, f1, file2, f2, 1, 0, 1, len[1], flags);
         if (format == D_IFDEF) {          if (format == D_IFDEF) {
                 for (;;) {                  for (;;) {
 #define c i0  #define c i0
Line 1003 
Line 1002 
  * lines missing from the to file.   * lines missing from the to file.
  */   */
 static void  static void
 change(char *file1, FILE *f1, char *file2, FILE *f2, int a, int b, int c, int d)  change(char *file1, FILE *f1, char *file2, FILE *f2, int a, int b, int c, int d,
       int flags)
 {  {
         static size_t max_context = 64;          static size_t max_context = 64;
         int i;          int i;
Line 1037 
Line 1037 
                 return;                  return;
         }          }
 proceed:  proceed:
           if (flags & D_HEADER)
                   printf("%s %s %s\n", diffargs, file1, file2);
         if (format == D_CONTEXT || format == D_UNIFIED) {          if (format == D_CONTEXT || format == D_UNIFIED) {
                 /*                  /*
                  * Allocate change records as needed.                   * Allocate change records as needed.

Legend:
Removed from v.1.64  
changed lines
  Added in v.1.65