version 1.89, 2006/04/14 02:45:35 |
version 1.90, 2006/04/14 23:29:01 |
|
|
static int context = 3; |
static int context = 3; |
int diff_format = D_NORMAL; |
int diff_format = D_NORMAL; |
char *diff_file = NULL; |
char *diff_file = NULL; |
|
RCSNUM *diff_rev1 = NULL; |
|
RCSNUM *diff_rev2 = NULL; |
char diffargs[128]; |
char diffargs[128]; |
static struct stat stb1, stb2; |
static struct stat stb1, stb2; |
static char *ifdefname, *ignore_pats; |
static char *ifdefname, *ignore_pats; |
|
|
static void |
static void |
change(FILE *f1, FILE *f2, int a, int b, int c, int d) |
change(FILE *f1, FILE *f2, int a, int b, int c, int d) |
{ |
{ |
static size_t max_context = 64; |
|
int i; |
int i; |
|
static size_t max_context = 64; |
|
char buf[64]; |
|
struct tm *t; |
|
|
if (diff_format != D_IFDEF && a > b && c > d) |
if (diff_format != D_IFDEF && a > b && c > d) |
return; |
return; |
|
|
/* |
/* |
* Print the context/unidiff header first time through. |
* Print the context/unidiff header first time through. |
*/ |
*/ |
|
t = localtime(&stb1.st_mtime); |
|
(void)strftime(buf, sizeof(buf), |
|
"%Y/%m/%d %H:%M:%S", t); |
|
|
diff_output("%s %s %s", |
diff_output("%s %s %s", |
diff_format == D_CONTEXT ? "***" : "---", diff_file, |
diff_format == D_CONTEXT ? "***" : "---", diff_file, |
ctime(&stb1.st_mtime)); |
buf); |
|
|
|
if (diff_rev1 != NULL) { |
|
rcsnum_tostr(diff_rev1, buf, sizeof(buf)); |
|
diff_output("\t%s", buf); |
|
} |
|
|
|
printf("\n"); |
|
|
|
t = localtime(&stb2.st_mtime); |
|
(void)strftime(buf, sizeof(buf), |
|
"%Y/%m/%d %H:%M:%S", t); |
|
|
diff_output("%s %s %s", |
diff_output("%s %s %s", |
diff_format == D_CONTEXT ? "---" : "+++", diff_file, |
diff_format == D_CONTEXT ? "---" : "+++", diff_file, |
ctime(&stb2.st_mtime)); |
buf); |
|
|
|
if (diff_rev2 != NULL) { |
|
rcsnum_tostr(diff_rev2, buf, sizeof(buf)); |
|
diff_output("\t%s", buf); |
|
} |
|
|
|
printf("\n"); |
anychange = 1; |
anychange = 1; |
} else if (a > context_vec_ptr->b + (2 * context) + 1 && |
} else if (a > context_vec_ptr->b + (2 * context) + 1 && |
c > context_vec_ptr->d + (2 * context) + 1) { |
c > context_vec_ptr->d + (2 * context) + 1) { |