diff options
author | 2003-06-26 22:04:45 +0000 | |
---|---|---|
committer | 2003-06-26 22:04:45 +0000 | |
commit | 90f56ad89a9a2865b738e2fb968a31f24e4f9aa7 (patch) | |
tree | 4862bca2cbfdd44d767642134646b99aeb1c2827 /usr.bin/diff/diffreg.c | |
parent | more proto fixes (diff) | |
download | wireguard-openbsd-90f56ad89a9a2865b738e2fb968a31f24e4f9aa7.tar.xz wireguard-openbsd-90f56ad89a9a2865b738e2fb968a31f24e4f9aa7.zip |
Remove cruft; We don't have the -I, -1 or -2 options anymore so we don't
need the associated scaffolding. tedu@ OK
Diffstat (limited to 'usr.bin/diff/diffreg.c')
-rw-r--r-- | usr.bin/diff/diffreg.c | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 0707749ae40..be2e9bfe466 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diffreg.c,v 1.21 2003/06/26 18:19:29 millert Exp $ */ +/* $OpenBSD: diffreg.c,v 1.22 2003/06/26 22:04:45 millert Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -792,7 +792,7 @@ change(int a, int b, int c, int d) } 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 * record. If the record is full or if this * change is more than 'context' lines from the previous @@ -849,7 +849,7 @@ change(int a, int b, int c, int d) if ((opt == D_EDIT || opt == D_REVERSE) && c <= d) prints(".\n"); if (inifdef) { - fprintf(stdout, "#endif /* %s */\n", endifname); + fprintf(stdout, "#endif /* %s */\n", ifdefname); inifdef = 0; } } @@ -865,7 +865,6 @@ range(int a, int b, char *separator) 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; /* @@ -882,21 +881,14 @@ fetch(long *f, int a, int b, FILE *lb, char *s, int oldfile) if (a > b) return; if (opt == D_IFDEF) { - if (inifdef) + 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); - } + oldfile == 1 ? "!" : "", ifdefname); + } else { + if (oldfile) + fprintf(stdout, "#ifndef %s\n", ifdefname); + else + fprintf(stdout, "#ifdef %s\n", ifdefname); } inifdef = 1 + oldfile; } @@ -918,11 +910,6 @@ fetch(long *f, int a, int b, FILE *lb, char *s, int oldfile) } } } - - if (inifdef && !wantelses) { - fprintf(stdout, "#endif /* %s */\n", endifname); - inifdef = 0; - } } #define POW2 /* define only if HALFLONG is 2**n */ @@ -1023,7 +1010,7 @@ dump_context_vec(void) int a, b, c, d; char ch; - if (cvp > context_vec_ptr) + if (context_vec_start > context_vec_ptr) return; b = d = 0; /* gcc */ @@ -1120,7 +1107,7 @@ dump_unified_vec(void) int a, b, c, d; char ch; - if (cvp > context_vec_ptr) + if (context_vec_start > context_vec_ptr) return; b = d = 0; /* gcc */ |