=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/diff/diffreg.c,v retrieving revision 1.21 retrieving revision 1.22 diff -c -r1.21 -r1.22 *** src/usr.bin/diff/diffreg.c 2003/06/26 18:19:29 1.21 --- src/usr.bin/diff/diffreg.c 2003/06/26 22:04:45 1.22 *************** *** 1,4 **** ! /* $OpenBSD: diffreg.c,v 1.21 2003/06/26 18:19:29 millert Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. --- 1,4 ---- ! /* $OpenBSD: diffreg.c,v 1.22 2003/06/26 22:04:45 millert Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. *************** *** 792,798 **** } if (opt == D_CONTEXT || opt == D_UNIFIED) { /* ! * if this new change is within 'context' lines of * the previous change, just add it to the change * record. If the record is full or if this * change is more than 'context' lines from the previous --- 792,798 ---- } if (opt == D_CONTEXT || opt == D_UNIFIED) { /* ! * If this new change is within 'context' lines of * the previous change, just add it to the change * record. If the record is full or if this * change is more than 'context' lines from the previous *************** *** 849,855 **** if ((opt == D_EDIT || opt == D_REVERSE) && c <= d) prints(".\n"); if (inifdef) { ! fprintf(stdout, "#endif /* %s */\n", endifname); inifdef = 0; } } --- 849,855 ---- if ((opt == D_EDIT || opt == D_REVERSE) && c <= d) prints(".\n"); if (inifdef) { ! fprintf(stdout, "#endif /* %s */\n", ifdefname); inifdef = 0; } } *************** *** 865,871 **** static void 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; /* --- 865,870 ---- *************** *** 882,902 **** if (a > b) return; if (opt == D_IFDEF) { ! if (inifdef) fprintf(stdout, "#else /* %s%s */\n", ! oneflag && oldfile == 1 ? "!" : "", ifdef2); ! else { ! if (oneflag) { ! /* There was only one ifdef given */ ! endifname = ifdef2; ! if (oldfile) ! 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; } --- 881,894 ---- if (a > b) return; if (opt == D_IFDEF) { ! if (inifdef) { fprintf(stdout, "#else /* %s%s */\n", ! oldfile == 1 ? "!" : "", ifdefname); ! } else { ! if (oldfile) ! fprintf(stdout, "#ifndef %s\n", ifdefname); ! else ! fprintf(stdout, "#ifdef %s\n", ifdefname); } inifdef = 1 + oldfile; } *************** *** 918,928 **** } } } - - if (inifdef && !wantelses) { - fprintf(stdout, "#endif /* %s */\n", endifname); - inifdef = 0; - } } #define POW2 /* define only if HALFLONG is 2**n */ --- 910,915 ---- *************** *** 1023,1029 **** int a, b, c, d; char ch; ! if (cvp > context_vec_ptr) return; b = d = 0; /* gcc */ --- 1010,1016 ---- int a, b, c, d; char ch; ! if (context_vec_start > context_vec_ptr) return; b = d = 0; /* gcc */ *************** *** 1120,1126 **** int a, b, c, d; char ch; ! if (cvp > context_vec_ptr) return; b = d = 0; /* gcc */ --- 1107,1113 ---- int a, b, c, d; char ch; ! if (context_vec_start > context_vec_ptr) return; b = d = 0; /* gcc */