Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/nvi/dist Handle more cases where a screen has n...
details: https://anonhg.NetBSD.org/src/rev/70e492637902
branches: trunk
changeset: 325051:70e492637902
user: christos <christos%NetBSD.org@localhost>
date: Sun Dec 01 21:48:33 2013 +0000
description:
Handle more cases where a screen has not been fully initialized (inserted
into the scrq) by calling screen_fini() instead of screen_end() where
appropriate. Pointed out by chuq.
diffstat:
external/bsd/nvi/dist/common/screen.c | 20 +++++++++++++++-----
external/bsd/nvi/dist/ex/ex_args.c | 4 ++--
external/bsd/nvi/dist/ex/ex_edit.c | 4 ++--
external/bsd/nvi/dist/ex/ex_tag.c | 4 ++--
external/bsd/nvi/dist/vi/v_ex.c | 6 +++---
5 files changed, 24 insertions(+), 14 deletions(-)
diffs (130 lines):
diff -r 0d71f29e16d8 -r 70e492637902 external/bsd/nvi/dist/common/screen.c
--- a/external/bsd/nvi/dist/common/screen.c Sun Dec 01 20:15:42 2013 +0000
+++ b/external/bsd/nvi/dist/common/screen.c Sun Dec 01 21:48:33 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: screen.c,v 1.5 2013/12/01 02:34:54 christos Exp $ */
+/* $NetBSD: screen.c,v 1.6 2013/12/01 21:48:33 christos Exp $ */
/*-
* Copyright (c) 1993, 1994
* The Regents of the University of California. All rights reserved.
@@ -121,7 +121,7 @@
*spp = sp;
return (0);
-err: screen_end1(sp, 0);
+err: screen_fini(sp);
return (1);
}
@@ -197,9 +197,20 @@
}
/*
+ * screen_fini --
+ * Release a screen, that has not been chained to the screen queues.
+ *
+ * PUBLIC: int screen_fini __P((SCR *));
+ */
+int
+screen_fini(SCR *sp)
+{
+ return screen_end1(sp, 0);
+}
+
+/*
* screen_end --
- * Release a screen, no matter what had (and had not) been
- * initialized.
+ * Release a screen, that has been chained to the screen queues.
*
* PUBLIC: int screen_end __P((SCR *));
*/
@@ -208,7 +219,6 @@
{
return screen_end1(sp, 1);
}
-
/*
* screen_next --
* Return the next screen in the queue.
diff -r 0d71f29e16d8 -r 70e492637902 external/bsd/nvi/dist/ex/ex_args.c
--- a/external/bsd/nvi/dist/ex/ex_args.c Sun Dec 01 20:15:42 2013 +0000
+++ b/external/bsd/nvi/dist/ex/ex_args.c Sun Dec 01 21:48:33 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ex_args.c,v 1.2 2013/11/22 15:52:05 christos Exp $ */
+/* $NetBSD: ex_args.c,v 1.3 2013/12/01 21:48:33 christos Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
* The Regents of the University of California. All rights reserved.
@@ -141,7 +141,7 @@
if (screen_init(sp->gp, sp, &new))
return (1);
if (vs_split(sp, new, 0)) {
- (void)screen_end(new);
+ (void)screen_fini(new);
return (1);
}
diff -r 0d71f29e16d8 -r 70e492637902 external/bsd/nvi/dist/ex/ex_edit.c
--- a/external/bsd/nvi/dist/ex/ex_edit.c Sun Dec 01 20:15:42 2013 +0000
+++ b/external/bsd/nvi/dist/ex/ex_edit.c Sun Dec 01 21:48:33 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ex_edit.c,v 1.5 2013/12/01 02:34:54 christos Exp $ */
+/* $NetBSD: ex_edit.c,v 1.6 2013/12/01 21:48:33 christos Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
* The Regents of the University of California. All rights reserved.
@@ -120,7 +120,7 @@
return (1);
if ((cmdp->cmd == &cmds[C_VSPLIT] && vs_vsplit(sp, new)) ||
(cmdp->cmd != &cmds[C_VSPLIT] && vs_split(sp, new, 0))) {
- (void)screen_end(new);
+ (void)screen_fini(new);
return (1);
}
diff -r 0d71f29e16d8 -r 70e492637902 external/bsd/nvi/dist/ex/ex_tag.c
--- a/external/bsd/nvi/dist/ex/ex_tag.c Sun Dec 01 20:15:42 2013 +0000
+++ b/external/bsd/nvi/dist/ex/ex_tag.c Sun Dec 01 21:48:33 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ex_tag.c,v 1.9 2013/12/01 02:34:54 christos Exp $ */
+/* $NetBSD: ex_tag.c,v 1.10 2013/12/01 21:48:33 christos Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
* The Regents of the University of California. All rights reserved.
@@ -302,7 +302,7 @@
return (1);
if (vs_split(sp, new, 0)) {
(void)file_end(new, new->ep, 1);
- (void)screen_end(new);
+ (void)screen_fini(new);
return (1);
}
diff -r 0d71f29e16d8 -r 70e492637902 external/bsd/nvi/dist/vi/v_ex.c
--- a/external/bsd/nvi/dist/vi/v_ex.c Sun Dec 01 20:15:42 2013 +0000
+++ b/external/bsd/nvi/dist/vi/v_ex.c Sun Dec 01 21:48:33 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: v_ex.c,v 1.5 2013/12/01 02:34:54 christos Exp $ */
+/* $NetBSD: v_ex.c,v 1.6 2013/12/01 21:48:33 christos Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
* The Regents of the University of California. All rights reserved.
@@ -516,7 +516,7 @@
if (screen_init(gp, sp, &new))
return (1);
if (vs_split(sp, new, 1)) {
- (void)screen_end(new);
+ (void)screen_fini(new);
return (1);
}
@@ -651,7 +651,7 @@
return (1);
conv_enc(wp->ccl_sp, O_FILEENCODING, "WCHAR_T");
if (file_init(wp->ccl_sp, frp, NULL, 0)) {
- (void)screen_end(wp->ccl_sp);
+ (void)screen_fini(wp->ccl_sp);
wp->ccl_sp = 0;
return (1);
}
Home |
Main Index |
Thread Index |
Old Index