diff options
author | Vincent Labrecque <vincent@cvs.openbsd.org> | 2002-05-29 12:45:00 +0000 |
---|---|---|
committer | Vincent Labrecque <vincent@cvs.openbsd.org> | 2002-05-29 12:45:00 +0000 |
commit | bbcb18ac1215ba5f3c59a8931c4984c374031232 (patch) | |
tree | 3756875e3ced5bfca4d87fb6a7765e7baa392c37 /usr.bin/mg/word.c | |
parent | 72654f620c12e7d0fb15f20c99ee85298a14250f (diff) |
Add a few missing tests for BFREADONLY.
ok art@
Diffstat (limited to 'usr.bin/mg/word.c')
-rw-r--r-- | usr.bin/mg/word.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/usr.bin/mg/word.c b/usr.bin/mg/word.c index e1dfe2bb908..e92c667ade4 100644 --- a/usr.bin/mg/word.c +++ b/usr.bin/mg/word.c @@ -1,4 +1,4 @@ -/* $OpenBSD: word.c,v 1.6 2002/02/21 15:27:29 deraadt Exp $ */ +/* $OpenBSD: word.c,v 1.7 2002/05/29 12:44:59 vincent Exp $ */ /* * Word mode commands. @@ -69,6 +69,11 @@ upperword(f, n) { int c; + if (curbp->b_flag & BFREADONLY) { + ewprintf("Buffer is read-only"); + return (FALSE); + } + if (n < 0) return FALSE; while (n--) { @@ -101,6 +106,10 @@ lowerword(f, n) { int c; + if (curbp->b_flag & BFREADONLY) { + ewprintf("Buffer is read-only"); + return (FALSE); + } if (n < 0) return FALSE; while (n--) { @@ -135,6 +144,11 @@ capword(f, n) { int c; + if (curbp->b_flag & BFREADONLY) { + ewprintf("Buffer is read-only"); + return (FALSE); + } + if (n < 0) return FALSE; while (n--) { @@ -178,6 +192,10 @@ delfword(f, n) LINE *dotp; int doto; + if (curbp->b_flag & BFREADONLY) { + ewprintf("Buffer is read-only"); + return (FALSE); + } if (n < 0) return FALSE; @@ -226,6 +244,11 @@ delbword(f, n) { RSIZE size; + if (curbp->b_flag & BFREADONLY) { + ewprintf("Buffer is read-only"); + return (FALSE); + } + if (n < 0) return FALSE; |