diff options
author | 2019-08-10 16:13:46 +0000 | |
---|---|---|
committer | 2019-08-10 16:13:46 +0000 | |
commit | 5df02055d479c52dd0811a5a628f872fce9c5d9c (patch) | |
tree | a14f97a8fb4f4746b64d94ff6ba23d1153a99311 /usr.bin/rcs | |
parent | this introduces experimental proxy v2 support which is fairly isolated to a (diff) | |
download | wireguard-openbsd-5df02055d479c52dd0811a5a628f872fce9c5d9c.tar.xz wireguard-openbsd-5df02055d479c52dd0811a5a628f872fce9c5d9c.zip |
Fix merge(1) of files which contain lines with leading dots.
A check which tried to detect "dot on a line of its own" in the
internal ed script was treating any line with a leading dot as such.
Changes made to groups of such lines therefore ended up being
truncated in the merged result.
"For a random user, there's no shame in being unable to use ed."
-- Michael W Lucas
ok millert@ deraadt@
Diffstat (limited to 'usr.bin/rcs')
-rw-r--r-- | usr.bin/rcs/diff3.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/rcs/diff3.c b/usr.bin/rcs/diff3.c index 16cc1b29ff5..a75efd0ada6 100644 --- a/usr.bin/rcs/diff3.c +++ b/usr.bin/rcs/diff3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff3.c,v 1.41 2016/10/18 21:06:52 millert Exp $ */ +/* $OpenBSD: diff3.c,v 1.42 2019/08/10 16:13:46 stsp Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -496,7 +496,7 @@ ed_patch_lines(struct rcs_lines *dlines, struct rcs_lines *plines) if (lp == NULL) errx(1, "ed_patch_lines"); - if (!memcmp(lp->l_line, ".", 1)) + if (lp->l_len == 2 && lp->l_line[0] == '.') break; TAILQ_REMOVE(&(plines->l_lines), lp, l_list); |