=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mg/region.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- src/usr.bin/mg/region.c 2006/12/16 17:00:03 1.25 +++ src/usr.bin/mg/region.c 2008/06/10 23:23:53 1.26 @@ -1,4 +1,4 @@ -/* $OpenBSD: region.c,v 1.25 2006/12/16 17:00:03 kjell Exp $ */ +/* $OpenBSD: region.c,v 1.26 2008/06/10 23:23:53 kjell Exp $ */ /* This file is in the public domain. */ @@ -16,7 +16,7 @@ /* * Kill the region. Ask "getregion" to figure out the bounds of the region. - * Move "." to the start, and kill the characters. + * Move "." to the start, and kill the characters. Mark is cleared afterwards. */ /* ARGSUSED */ int @@ -34,14 +34,15 @@ curwp->w_dotp = region.r_linep; curwp->w_doto = region.r_offset; s = ldelete(region.r_size, KFORW); - if (s == TRUE && curwp->w_dotline > curwp->w_markline) - curwp->w_dotline = curwp->w_markline; + clearmark(FFARG, 0); + return (s); } /* - * Copy all of the characters in the region to the kill buffer. Don't move - * dot at all. This is a bit like a kill region followed by a yank. + * Copy all of the characters in the region to the kill buffer, + * clearing the mark afterwards. + * This is a bit like a kill region followed by a yank. */ /* ARGSUSED */ int @@ -78,6 +79,8 @@ ++loffs; } } + clearmark(FFARG, 0); + return (TRUE); }