diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2009-02-25 23:16:21 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2009-02-25 23:16:21 +0000 |
commit | 184bf0c4485793e104c9bf4074197d14c4589a6d (patch) | |
tree | 462f08c7cc5babc436484fe630c80054d6708ba6 | |
parent | 66c5025e30b2accbce550b2b478ce012e9da04a1 (diff) |
Checking if a file is ASCII should only be done when diffing, because
the non-ASCII characters could be printed to the screen. For
checking in files, checking out files, merging files, and removing
revisions of files, we do so regardless of whether the files are
ASCII or binary.
Fixes PR6031.
OK joris and deraadt.
-rw-r--r-- | usr.bin/rcs/ci.c | 4 | ||||
-rw-r--r-- | usr.bin/rcs/co.c | 4 | ||||
-rw-r--r-- | usr.bin/rcs/diff3.c | 12 | ||||
-rw-r--r-- | usr.bin/rcs/rcs.c | 4 |
4 files changed, 12 insertions, 12 deletions
diff --git a/usr.bin/rcs/ci.c b/usr.bin/rcs/ci.c index 03233c9cedc..c88f6b5536d 100644 --- a/usr.bin/rcs/ci.c +++ b/usr.bin/rcs/ci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ci.c,v 1.204 2008/03/22 21:15:54 millert Exp $ */ +/* $OpenBSD: ci.c,v 1.205 2009/02/25 23:16:20 ray Exp $ */ /* * Copyright (c) 2005, 2006 Niall O'Higgins <niallo@openbsd.org> * All rights reserved. @@ -378,7 +378,7 @@ checkin_diff_file(struct checkin_params *pb) b2 = NULL; diff_format = D_RCSDIFF; - if (diffreg(path1, path2, b3, 0) == D_ERROR) + if (diffreg(path1, path2, b3, D_FORCEASCII) == D_ERROR) goto out; return (b3); diff --git a/usr.bin/rcs/co.c b/usr.bin/rcs/co.c index 12b62905dad..3619d149de7 100644 --- a/usr.bin/rcs/co.c +++ b/usr.bin/rcs/co.c @@ -1,4 +1,4 @@ -/* $OpenBSD: co.c,v 1.109 2007/07/03 00:56:23 ray Exp $ */ +/* $OpenBSD: co.c,v 1.110 2009/02/25 23:16:20 ray Exp $ */ /* * Copyright (c) 2005 Joris Vink <joris@openbsd.org> * All rights reserved. @@ -550,7 +550,7 @@ checkout_file_has_diffs(RCSFILE *rfp, RCSNUM *frev, const char *dst) rcs_buf_empty(bp); diff_format = D_RCSDIFF; - ret = diffreg(dst, tempfile, bp, 0); + ret = diffreg(dst, tempfile, bp, D_FORCEASCII); rcs_buf_free(bp); unlink(tempfile); diff --git a/usr.bin/rcs/diff3.c b/usr.bin/rcs/diff3.c index a9b5300d083..ffbc73c3dc4 100644 --- a/usr.bin/rcs/diff3.c +++ b/usr.bin/rcs/diff3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff3.c,v 1.26 2008/03/02 19:40:58 tobias Exp $ */ +/* $OpenBSD: diff3.c,v 1.27 2009/02/25 23:16:20 ray Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -72,7 +72,7 @@ static const char copyright[] = #ifndef lint static const char rcsid[] = - "$OpenBSD: diff3.c,v 1.26 2008/03/02 19:40:58 tobias Exp $"; + "$OpenBSD: diff3.c,v 1.27 2009/02/25 23:16:20 ray Exp $"; #endif /* not lint */ #include <ctype.h> @@ -199,8 +199,8 @@ merge_diff3(char **av, int flags) rcs_buf_free(b2); b2 = NULL; - if ((diffreg(path1, path3, d1, 0) == D_ERROR) || - (diffreg(path2, path3, d2, 0) == D_ERROR)) { + if ((diffreg(path1, path3, d1, D_FORCEASCII) == D_ERROR) || + (diffreg(path2, path3, d2, D_FORCEASCII) == D_ERROR)) { rcs_buf_free(diffb); diffb = NULL; goto out; @@ -326,8 +326,8 @@ rcs_diff3(RCSFILE *rf, char *workfile, RCSNUM *rev1, RCSNUM *rev2, int flags) rcs_buf_free(b2); b2 = NULL; - if ((diffreg(path1, path3, d1, 0) == D_ERROR) || - (diffreg(path2, path3, d2, 0) == D_ERROR)) { + if ((diffreg(path1, path3, d1, D_FORCEASCII) == D_ERROR) || + (diffreg(path2, path3, d2, D_FORCEASCII) == D_ERROR)) { rcs_buf_free(diffb); diffb = NULL; goto out; diff --git a/usr.bin/rcs/rcs.c b/usr.bin/rcs/rcs.c index 9b5864ffeb3..eadf7b576c6 100644 --- a/usr.bin/rcs/rcs.c +++ b/usr.bin/rcs/rcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.52 2009/02/15 13:40:33 joris Exp $ */ +/* $OpenBSD: rcs.c,v 1.53 2009/02/25 23:16:20 ray Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -1472,7 +1472,7 @@ rcs_rev_remove(RCSFILE *rf, RCSNUM *rev) rcs_buf_free(prevbuf); diff_format = D_RCSDIFF; - if (diffreg(path_tmp1, path_tmp2, newdiff, 0) == D_ERROR) + if (diffreg(path_tmp1, path_tmp2, newdiff, D_FORCEASCII) == D_ERROR) errx(1, "diffreg failed"); newdeltatext = newdiff; |