AmendHub

Download (as of this amendment):

jcs

/

amend

/

amendments

/

163

diffreg: Hoist max_context up and reset it properly between runs


jcs made amendment 163 25 days ago
--- diffreg.c Mon Nov 4 08:40:02 2024 +++ diffreg.c Sun Sep 27 16:57:29 2026 @@ -219,6 +219,7 @@ static u_char *chrtran; /* translation table for cas static struct context_vec *context_vec_start; static struct context_vec *context_vec_end; static struct context_vec *context_vec_ptr; +static size_t max_context; #define FUNCTION_CONTEXT_SIZE 55 static char lastbuf[FUNCTION_CONTEXT_SIZE]; @@ -298,7 +299,8 @@ diffreg(char *file1, char *file2, int flags) clistlen = 0; sfile[0] = sfile[1] = NULL; context_vec_start = context_vec_end = context_vec_ptr = NULL; - + max_context = 64; + f1 = f2 = NULL; rval = D_SAME; anychange = 0; @@ -921,7 +923,6 @@ 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; restart: