[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.21 and 1.22

version 1.21, 2003/06/26 18:19:29 version 1.22, 2003/06/26 22:04:45
Line 792 
Line 792 
         }          }
         if (opt == D_CONTEXT || opt == D_UNIFIED) {          if (opt == D_CONTEXT || opt == D_UNIFIED) {
                 /*                  /*
                  * if this new change is within 'context' lines of                   * If this new change is within 'context' lines of
                  * the previous change, just add it to the change                   * the previous change, just add it to the change
                  * record.  If the record is full or if this                   * record.  If the record is full or if this
                  * change is more than 'context' lines from the previous                   * change is more than 'context' lines from the previous
Line 849 
Line 849 
         if ((opt == D_EDIT || opt == D_REVERSE) && c <= d)          if ((opt == D_EDIT || opt == D_REVERSE) && c <= d)
                 prints(".\n");                  prints(".\n");
         if (inifdef) {          if (inifdef) {
                 fprintf(stdout, "#endif /* %s */\n", endifname);                  fprintf(stdout, "#endif /* %s */\n", ifdefname);
                 inifdef = 0;                  inifdef = 0;
         }          }
 }  }
Line 865 
Line 865 
 static void  static void
 fetch(long *f, int a, int b, FILE *lb, char *s, int oldfile)  fetch(long *f, int a, int b, FILE *lb, char *s, int oldfile)
 {  {
         int oneflag = (*ifdef1 != '\0') != (*ifdef2 != '\0');  
         int i, j, c, col, nc;          int i, j, c, col, nc;
   
         /*          /*
Line 882 
Line 881 
         if (a > b)          if (a > b)
                 return;                  return;
         if (opt == D_IFDEF) {          if (opt == D_IFDEF) {
                 if (inifdef)                  if (inifdef) {
                         fprintf(stdout, "#else /* %s%s */\n",                          fprintf(stdout, "#else /* %s%s */\n",
                             oneflag && oldfile == 1 ? "!" : "", ifdef2);                              oldfile == 1 ? "!" : "", ifdefname);
                 else {                  } else {
                         if (oneflag) {                          if (oldfile)
                                 /* There was only one ifdef given */                                  fprintf(stdout, "#ifndef %s\n", ifdefname);
                                 endifname = ifdef2;                          else
                                 if (oldfile)                                  fprintf(stdout, "#ifdef %s\n", ifdefname);
                                         fprintf(stdout, "#ifndef %s\n", endifname);  
                                 else  
                                         fprintf(stdout, "#ifdef %s\n", endifname);  
                         } else {  
                                 endifname = oldfile ? ifdef1 : ifdef2;  
                                 fprintf(stdout, "#ifdef %s\n", endifname);  
                         }  
                 }                  }
                 inifdef = 1 + oldfile;                  inifdef = 1 + oldfile;
         }          }
Line 918 
Line 910 
                         }                          }
                 }                  }
         }          }
   
         if (inifdef && !wantelses) {  
                 fprintf(stdout, "#endif /* %s */\n", endifname);  
                 inifdef = 0;  
         }  
 }  }
   
 #define POW2                    /* define only if HALFLONG is 2**n */  #define POW2                    /* define only if HALFLONG is 2**n */
Line 1023 
Line 1010 
         int a, b, c, d;          int a, b, c, d;
         char ch;          char ch;
   
         if (cvp > context_vec_ptr)          if (context_vec_start > context_vec_ptr)
                 return;                  return;
   
         b = d = 0;              /* gcc */          b = d = 0;              /* gcc */
Line 1120 
Line 1107 
         int a, b, c, d;          int a, b, c, d;
         char ch;          char ch;
   
         if (cvp > context_vec_ptr)          if (context_vec_start > context_vec_ptr)
                 return;                  return;
   
         b = d = 0;              /* gcc */          b = d = 0;              /* gcc */

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22