diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2006-05-31 22:24:13 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2006-05-31 22:24:13 +0000 |
commit | b59294d37b551983fbf7b23539b9982c6fb34ab7 (patch) | |
tree | 2e4a6a6673a3110f0efc88488f468ea33f8ca837 /usr.bin | |
parent | 99b922fe751cf92f0f69b7b36f9f972376a662bc (diff) |
support -p flag for diff, makes dlg@ feel all warm
and fuzzie inside.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/cvs/diff.c | 11 | ||||
-rw-r--r-- | usr.bin/cvs/diff.h | 3 | ||||
-rw-r--r-- | usr.bin/cvs/diff_internals.c | 9 |
3 files changed, 17 insertions, 6 deletions
diff --git a/usr.bin/cvs/diff.c b/usr.bin/cvs/diff.c index b3bfa5e67c8..30683f2f7dd 100644 --- a/usr.bin/cvs/diff.c +++ b/usr.bin/cvs/diff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff.c,v 1.100 2006/05/31 07:21:25 joris Exp $ */ +/* $OpenBSD: diff.c,v 1.101 2006/05/31 22:24:12 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -68,6 +68,10 @@ cvs_diff(int argc, char **argv) strlcat(diffargs, " -N", sizeof(diffargs)); Nflag = 1; break; + case 'p': + strlcat(diffargs, " -p", sizeof(diffargs)); + diff_pflag = 1; + break; case 'r': if (rev1 == NULL) { rev1 = optarg; @@ -253,5 +257,10 @@ cvs_diff_local(struct cvs_file *cf) cvs_diffreg(p1, p2, NULL); cvs_worklist_run(&temp_files, cvs_worklist_unlink); + if (diff_rev1 != NULL && diff_rev1 != cf->file_ent->ce_rev) + rcsnum_free(diff_rev1); + if (diff_rev2 != NULL && diff_rev2 != cf->file_rcsrev) + rcsnum_free(diff_rev2); + diff_rev1 = diff_rev2 = NULL; } diff --git a/usr.bin/cvs/diff.h b/usr.bin/cvs/diff.h index 8ed8b8bc865..686ececbf2e 100644 --- a/usr.bin/cvs/diff.h +++ b/usr.bin/cvs/diff.h @@ -1,4 +1,4 @@ -/* $OpenBSD: diff.h,v 1.11 2006/05/27 03:30:30 joris Exp $ */ +/* $OpenBSD: diff.h,v 1.12 2006/05/31 22:24:12 joris Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. * All rights reserved. @@ -98,6 +98,7 @@ int ed_patch_lines(struct cvs_lines *, struct cvs_lines *); extern int diff_format; extern int diff3_conflicts; +extern int diff_pflag; extern char *diff_file; extern char diffargs[128]; extern BUF *diffbuf; diff --git a/usr.bin/cvs/diff_internals.c b/usr.bin/cvs/diff_internals.c index f5e8b95278b..5a37ec4c86d 100644 --- a/usr.bin/cvs/diff_internals.c +++ b/usr.bin/cvs/diff_internals.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff_internals.c,v 1.1 2006/05/27 03:30:30 joris Exp $ */ +/* $OpenBSD: diff_internals.c,v 1.2 2006/05/31 22:24:12 joris Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. * All rights reserved. @@ -191,9 +191,10 @@ static int files_differ(FILE *, FILE *); static char *match_function(const long *, int, FILE *); static char *preadline(int, size_t, off_t); -static int aflag, bflag, dflag, iflag, pflag, tflag, Tflag, wflag; +static int aflag, bflag, dflag, iflag, tflag, Tflag, wflag; static int context = 3; int diff_format = D_NORMAL; +int diff_pflag = 0; char *diff_file = NULL; RCSNUM *diff_rev1 = NULL; RCSNUM *diff_rev2 = NULL; @@ -1212,7 +1213,7 @@ dump_context_vec(FILE *f1, FILE *f2) upd = MIN(diff_len[1], context_vec_ptr->d + context); diff_output("***************"); - if (pflag == 1) { + if (diff_pflag == 1) { f = match_function(ixold, lowa - 1, f1); if (f != NULL) { diff_output(" "); @@ -1321,7 +1322,7 @@ dump_unified_vec(FILE *f1, FILE *f2) diff_output(" +"); uni_range(lowc, upd); diff_output(" @@"); - if (pflag == 1) { + if (diff_pflag == 1) { f = match_function(ixold, lowa - 1, f1); if (f != NULL) { diff_output(" "); |