version 1.81, 2006/03/23 13:09:09 |
version 1.82, 2006/03/24 13:34:27 |
|
|
|
|
#if !defined(RCSPROG) |
#if !defined(RCSPROG) |
static struct diff_arg *dap = NULL; |
static struct diff_arg *dap = NULL; |
static int recurse; |
|
|
|
static int |
static int |
cvs_diff_init(struct cvs_cmd *cmd, int argc, char **argv, int *arg) |
cvs_diff_init(struct cvs_cmd *cmd, int argc, char **argv, int *arg) |
|
|
break; |
break; |
case 'l': |
case 'l': |
strlcat(diffargs, " -l", sizeof(diffargs)); |
strlcat(diffargs, " -l", sizeof(diffargs)); |
recurse = 0; |
|
cvs_cmd_diff.file_flags &= ~CF_RECURSE; |
cvs_cmd_diff.file_flags &= ~CF_RECURSE; |
break; |
break; |
case 'i': |
case 'i': |
|
|
static int |
static int |
cvs_diff_remote(struct cvs_file *cfp, void *arg) |
cvs_diff_remote(struct cvs_file *cfp, void *arg) |
{ |
{ |
char *dir, *repo; |
char fpath[MAXPATHLEN]; |
char fpath[MAXPATHLEN], dfpath[MAXPATHLEN]; |
|
struct cvsroot *root; |
struct cvsroot *root; |
|
|
if (cfp->cf_type == DT_DIR) { |
if (cfp->cf_type == DT_DIR) { |
|
|
|
|
diff_file = cvs_file_getpath(cfp, fpath, sizeof(fpath)); |
diff_file = cvs_file_getpath(cfp, fpath, sizeof(fpath)); |
|
|
if (cfp->cf_parent != NULL) { |
if (cfp->cf_parent != NULL) |
dir = cvs_file_getpath(cfp->cf_parent, dfpath, sizeof(dfpath)); |
|
root = cfp->cf_parent->cf_root; |
root = cfp->cf_parent->cf_root; |
repo = cfp->cf_parent->cf_repo; |
else |
} else { |
|
dir = "."; |
|
root = NULL; |
root = NULL; |
repo = NULL; |
|
} |
|
|
|
if (cfp->cf_cvstat == CVS_FST_UNKNOWN) { |
if (cfp->cf_cvstat == CVS_FST_UNKNOWN) { |
cvs_sendreq(root, CVS_REQ_QUESTIONABLE, cfp->cf_name); |
cvs_sendreq(root, CVS_REQ_QUESTIONABLE, cfp->cf_name); |
|
|
static int |
static int |
cvs_diff_local(CVSFILE *cf, void *arg) |
cvs_diff_local(CVSFILE *cf, void *arg) |
{ |
{ |
char *repo, buf[64]; |
char buf[64]; |
char fpath[MAXPATHLEN], rcspath[MAXPATHLEN]; |
char fpath[MAXPATHLEN], rcspath[MAXPATHLEN]; |
char path_tmp1[MAXPATHLEN], path_tmp2[MAXPATHLEN]; |
char path_tmp1[MAXPATHLEN], path_tmp2[MAXPATHLEN]; |
BUF *b1, *b2; |
BUF *b1, *b2; |
RCSNUM *r1, *r2; |
RCSNUM *r1, *r2; |
RCSFILE *rf; |
RCSFILE *rf; |
struct cvsroot *root; |
|
struct timeval tv[2], tv2[2]; |
struct timeval tv[2], tv2[2]; |
|
|
memset(&tv, 0, sizeof(tv)); |
memset(&tv, 0, sizeof(tv)); |
memset(&tv2, 0, sizeof(tv2)); |
memset(&tv2, 0, sizeof(tv2)); |
|
|
rf = NULL; |
rf = NULL; |
root = CVS_DIR_ROOT(cf); |
|
repo = CVS_DIR_REPO(cf); |
|
diff_file = cvs_file_getpath(cf, fpath, sizeof(fpath)); |
diff_file = cvs_file_getpath(cf, fpath, sizeof(fpath)); |
|
|
if (cf->cf_type == DT_DIR) { |
if (cf->cf_type == DT_DIR) { |
|
|
static void |
static void |
fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile) |
fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile) |
{ |
{ |
int i, j, c, lastc, col, nc; |
long j, nc; |
|
int i, c, col; |
|
|
/* |
/* |
* When doing #ifdef's, copy down to current line |
* When doing #ifdef's, copy down to current line |
|
|
diff_output(" "); |
diff_output(" "); |
} |
} |
col = 0; |
col = 0; |
for (j = 0, lastc = '\0'; j < nc; j++, lastc = c) { |
for (j = 0; j < nc; j++) { |
if ((c = getc(lb)) == EOF) { |
if ((c = getc(lb)) == EOF) { |
if (diff_format == D_RCSDIFF) |
if (diff_format == D_RCSDIFF) |
cvs_log(LP_WARN, |
cvs_log(LP_WARN, |
|
|
asciifile(FILE *f) |
asciifile(FILE *f) |
{ |
{ |
char buf[BUFSIZ]; |
char buf[BUFSIZ]; |
int i, cnt; |
size_t i, cnt; |
|
|
if ((aflag == 1) || (f == NULL)) |
if ((aflag == 1) || (f == NULL)) |
return (1); |
return (1); |