=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/diff/diffreg.c,v retrieving revision 1.65 retrieving revision 1.66 diff -c -r1.65 -r1.66 *** src/usr.bin/diff/diffreg.c 2007/02/22 01:44:36 1.65 --- src/usr.bin/diff/diffreg.c 2007/02/23 08:03:19 1.66 *************** *** 1,4 **** ! /* $OpenBSD: diffreg.c,v 1.65 2007/02/22 01:44:36 millert Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. --- 1,4 ---- ! /* $OpenBSD: diffreg.c,v 1.66 2007/02/23 08:03:19 espie Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. *************** *** 65,71 **** */ #ifndef lint ! static const char rcsid[] = "$OpenBSD: diffreg.c,v 1.65 2007/02/22 01:44:36 millert Exp $"; #endif /* not lint */ #include --- 65,71 ---- */ #ifndef lint ! static const char rcsid[] = "$OpenBSD: diffreg.c,v 1.66 2007/02/23 08:03:19 espie Exp $"; #endif /* not lint */ #include *************** *** 212,218 **** static void equiv(struct line *, int, struct line *, int, int *); static void unravel(int); static void unsort(struct line *, int, int *); ! static void change(char *, FILE *, char *, FILE *, int, int, int, int, int); static void sort(struct line *, int); static void print_header(const char *, const char *); static int ignoreline(char *); --- 212,218 ---- static void equiv(struct line *, int, struct line *, int, int *); static void unravel(int); static void unsort(struct line *, int, int *); ! static void change(char *, FILE *, char *, FILE *, int, int, int, int, int *); static void sort(struct line *, int); static void print_header(const char *, const char *); static int ignoreline(char *); *************** *** 916,922 **** i1++; j1 = J[i1 + 1] - 1; J[i1] = j1; ! change(file1, f1, file2, f2, i0, i1, j0, j1, flags); } } else { for (i0 = m; i0 >= 1; i0 = i1 - 1) { --- 916,922 ---- i1++; j1 = J[i1 + 1] - 1; J[i1] = j1; ! change(file1, f1, file2, f2, i0, i1, j0, j1, &flags); } } else { for (i0 = m; i0 >= 1; i0 = i1 - 1) { *************** *** 928,938 **** i1--; j1 = J[i1 - 1] + 1; J[i1] = j1; ! change(file1, f1, file2, f2, i1, i0, j1, j0, flags); } } if (m == 0) ! change(file1, f1, file2, f2, 1, 0, 1, len[1], flags); if (format == D_IFDEF) { for (;;) { #define c i0 --- 928,938 ---- i1--; j1 = J[i1 - 1] + 1; J[i1] = j1; ! change(file1, f1, file2, f2, i1, i0, j1, j0, &flags); } } if (m == 0) ! change(file1, f1, file2, f2, 1, 0, 1, len[1], &flags); if (format == D_IFDEF) { for (;;) { #define c i0 *************** *** 1003,1009 **** */ static void 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; int i; --- 1003,1009 ---- */ static void change(char *file1, FILE *f1, char *file2, FILE *f2, int a, int b, int c, int d, ! int *pflags) { static size_t max_context = 64; int i; *************** *** 1037,1044 **** return; } proceed: ! if (flags & D_HEADER) printf("%s %s %s\n", diffargs, file1, file2); if (format == D_CONTEXT || format == D_UNIFIED) { /* * Allocate change records as needed. --- 1037,1046 ---- return; } proceed: ! if (*pflags & D_HEADER) { printf("%s %s %s\n", diffargs, file1, file2); + *pflags &= ~D_HEADER; + } if (format == D_CONTEXT || format == D_UNIFIED) { /* * Allocate change records as needed.