summaryrefslogtreecommitdiff
path: root/usr.bin/mg/line.c
diff options
context:
space:
mode:
authorKjell Wooding <kjell@cvs.openbsd.org>2006-07-25 08:27:10 +0000
committerKjell Wooding <kjell@cvs.openbsd.org>2006-07-25 08:27:10 +0000
commit6fa69567b7af822d74014fa4cbf3f5d3d8f34ffc (patch)
tree5ce76eb7ce91f51b9dd1960fbe251c0aa0c1e1b7 /usr.bin/mg/line.c
parentb27fa2f6a9aae6a0a87897200334b193aa2882dd (diff)
Add bfirstlp(), blastlp() macros, returning the first and last lines
of a buffer respectively. Removes an ugly construction than necessitated "go to first line"-type comments throughout the code. No binary change
Diffstat (limited to 'usr.bin/mg/line.c')
-rw-r--r--usr.bin/mg/line.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/mg/line.c b/usr.bin/mg/line.c
index 12d55c2851e..4710c57d8e2 100644
--- a/usr.bin/mg/line.c
+++ b/usr.bin/mg/line.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: line.c,v 1.41 2006/07/25 08:22:32 kjell Exp $ */
+/* $OpenBSD: line.c,v 1.42 2006/07/25 08:27:09 kjell Exp $ */
/* This file is in the public domain. */
@@ -426,8 +426,7 @@ ldelete(RSIZE n, int kflag)
chunk = n;
/* End of line, merge */
if (chunk == 0) {
- if (dotp == lback(curbp->b_headp))
- /* End of buffer */
+ if (dotp == blastlp(curbp))
return (FALSE);
lchange(WFFULL);
if (ldelnewline() == FALSE)