aboutsummaryrefslogtreecommitdiff
path: root/common/cut.c
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2026-01-14 13:57:09 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2026-01-14 13:57:09 +0000
commit3110ba77506bf66eef114d123fd8d091d443316a (patch)
tree3e2e55d54796084a0bb75d6df87696c00a4afca9 /common/cut.c
parentae7f9696aefd6ce7b024af37c4d2c32f6783d106 (diff)
Diffstat (limited to 'common/cut.c')
-rw-r--r--common/cut.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/cut.c b/common/cut.c
index 7d74f764a6d9..4b00d7c7b174 100644
--- a/common/cut.c
+++ b/common/cut.c
@@ -68,6 +68,10 @@ cut(SCR *sp, CHAR_T *namep, MARK *fm, MARK *tm, int flags)
recno_t lno;
int append, copy_one, copy_def;
+ /* Check if the line numbers are out-of-band */
+ if (fm->lno == OOBLNO || tm->lno == OOBLNO)
+ return (1);
+
/*
* If the user specified a buffer, put it there. (This may require
* a copy into the numeric buffers. We do the copy so that we don't
@@ -175,6 +179,7 @@ cut_line_err:
text_lfree(cbp->textq);
cbp->len = 0;
cbp->flags = 0;
+ sp->gp->dcbp = NULL;
return (1);
}