Pull up following revision(s) (requested by uwe in ticket #986): lib/libcurses/insch.c: revision 1.26 lib/libcurses/ins_wch.c: revision 1.15 lib/libcurses/ins_wstr.c: revision 1.15 lib/libcurses/insstr.c: revision 1.8 mvwins*(WINDOW *win, ...) functions - call wins* on win, not stdscr. >From Naman Jain in PR lib/55460.diff -r1.14 -r1.14.2.1 src/lib/libcurses/ins_wch.c
(martin)
--- src/lib/libcurses/ins_wch.c 2019/06/09 07:40:14 1.14
+++ src/lib/libcurses/ins_wch.c 2020/07/07 12:43:51 1.14.2.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ins_wch.c,v 1.14 2019/06/09 07:40:14 blymn Exp $ */ | 1 | /* $NetBSD: ins_wch.c,v 1.14.2.1 2020/07/07 12:43:51 martin Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2005 The NetBSD Foundation Inc. | 4 | * Copyright (c) 2005 The NetBSD Foundation Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from code donated to the NetBSD Foundation | 7 | * This code is derived from code donated to the NetBSD Foundation | |
8 | * by Ruibiao Qiu <ruibiao@arl.wustl.edu,ruibiao@gmail.com>. | 8 | * by Ruibiao Qiu <ruibiao@arl.wustl.edu,ruibiao@gmail.com>. | |
9 | * | 9 | * | |
10 | * | 10 | * | |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without | |
12 | * modification, are permitted provided that the following conditions | 12 | * modification, are permitted provided that the following conditions | |
13 | * are met: | 13 | * are met: | |
14 | * 1. Redistributions of source code must retain the above copyright | 14 | * 1. Redistributions of source code must retain the above copyright | |
@@ -26,27 +26,27 @@ | @@ -26,27 +26,27 @@ | |||
26 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 26 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
30 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 30 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
31 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 31 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
34 | * SUCH DAMAGE. | 34 | * SUCH DAMAGE. | |
35 | */ | 35 | */ | |
36 | 36 | |||
37 | #include <sys/cdefs.h> | 37 | #include <sys/cdefs.h> | |
38 | #ifndef lint | 38 | #ifndef lint | |
39 | __RCSID("$NetBSD: ins_wch.c,v 1.14 2019/06/09 07:40:14 blymn Exp $"); | 39 | __RCSID("$NetBSD: ins_wch.c,v 1.14.2.1 2020/07/07 12:43:51 martin Exp $"); | |
40 | #endif /* not lint */ | 40 | #endif /* not lint */ | |
41 | 41 | |||
42 | #include <string.h> | 42 | #include <string.h> | |
43 | #include <stdlib.h> | 43 | #include <stdlib.h> | |
44 | 44 | |||
45 | #include "curses.h" | 45 | #include "curses.h" | |
46 | #include "curses_private.h" | 46 | #include "curses_private.h" | |
47 | 47 | |||
48 | /* | 48 | /* | |
49 | * ins_wch -- | 49 | * ins_wch -- | |
50 | * Do an insert-char on the line, leaving (cury, curx) unchanged. | 50 | * Do an insert-char on the line, leaving (cury, curx) unchanged. | |
51 | */ | 51 | */ | |
52 | int | 52 | int | |
@@ -65,27 +65,27 @@ mvins_wch(int y, int x, const cchar_t *w | @@ -65,27 +65,27 @@ mvins_wch(int y, int x, const cchar_t *w | |||
65 | return mvwins_wch(stdscr, y, x, wch); | 65 | return mvwins_wch(stdscr, y, x, wch); | |
66 | } | 66 | } | |
67 | 67 | |||
68 | /* | 68 | /* | |
69 | * mvwins_wch -- | 69 | * mvwins_wch -- | |
70 | * Do an insert-char on the line at (y, x) in the given window. | 70 | * Do an insert-char on the line at (y, x) in the given window. | |
71 | */ | 71 | */ | |
72 | int | 72 | int | |
73 | mvwins_wch(WINDOW *win, int y, int x, const cchar_t *wch) | 73 | mvwins_wch(WINDOW *win, int y, int x, const cchar_t *wch) | |
74 | { | 74 | { | |
75 | if (wmove(win, y, x) == ERR) | 75 | if (wmove(win, y, x) == ERR) | |
76 | return ERR; | 76 | return ERR; | |
77 | 77 | |||
78 | return wins_wch(stdscr, wch); | 78 | return wins_wch(win, wch); | |
79 | } | 79 | } | |
80 | 80 | |||
81 | /* | 81 | /* | |
82 | * wins_wch -- | 82 | * wins_wch -- | |
83 | * Do an insert-char on the line, leaving (cury, curx) unchanged. | 83 | * Do an insert-char on the line, leaving (cury, curx) unchanged. | |
84 | */ | 84 | */ | |
85 | int | 85 | int | |
86 | wins_wch(WINDOW *win, const cchar_t *wch) | 86 | wins_wch(WINDOW *win, const cchar_t *wch) | |
87 | { | 87 | { | |
88 | __LDATA *start, *temp1, *temp2; | 88 | __LDATA *start, *temp1, *temp2; | |
89 | __LINE *lnp; | 89 | __LINE *lnp; | |
90 | int cw, pcw, x, y, sx, ex, newx, i; | 90 | int cw, pcw, x, y, sx, ex, newx, i; | |
91 | nschar_t *np, *tnp; | 91 | nschar_t *np, *tnp; |
--- src/lib/libcurses/ins_wstr.c 2019/06/09 07:40:14 1.14
+++ src/lib/libcurses/ins_wstr.c 2020/07/07 12:43:51 1.14.2.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ins_wstr.c,v 1.14 2019/06/09 07:40:14 blymn Exp $ */ | 1 | /* $NetBSD: ins_wstr.c,v 1.14.2.1 2020/07/07 12:43:51 martin Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2005 The NetBSD Foundation Inc. | 4 | * Copyright (c) 2005 The NetBSD Foundation Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from code donated to the NetBSD Foundation | 7 | * This code is derived from code donated to the NetBSD Foundation | |
8 | * by Ruibiao Qiu <ruibiao@arl.wustl.edu,ruibiao@gmail.com>. | 8 | * by Ruibiao Qiu <ruibiao@arl.wustl.edu,ruibiao@gmail.com>. | |
9 | * | 9 | * | |
10 | * | 10 | * | |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without | |
12 | * modification, are permitted provided that the following conditions | 12 | * modification, are permitted provided that the following conditions | |
13 | * are met: | 13 | * are met: | |
14 | * 1. Redistributions of source code must retain the above copyright | 14 | * 1. Redistributions of source code must retain the above copyright | |
@@ -26,27 +26,27 @@ | @@ -26,27 +26,27 @@ | |||
26 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 26 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
30 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 30 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
31 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 31 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
34 | * SUCH DAMAGE. | 34 | * SUCH DAMAGE. | |
35 | */ | 35 | */ | |
36 | 36 | |||
37 | #include <sys/cdefs.h> | 37 | #include <sys/cdefs.h> | |
38 | #ifndef lint | 38 | #ifndef lint | |
39 | __RCSID("$NetBSD: ins_wstr.c,v 1.14 2019/06/09 07:40:14 blymn Exp $"); | 39 | __RCSID("$NetBSD: ins_wstr.c,v 1.14.2.1 2020/07/07 12:43:51 martin Exp $"); | |
40 | #endif /* not lint */ | 40 | #endif /* not lint */ | |
41 | 41 | |||
42 | #include <string.h> | 42 | #include <string.h> | |
43 | #include <stdlib.h> | 43 | #include <stdlib.h> | |
44 | 44 | |||
45 | #include "curses.h" | 45 | #include "curses.h" | |
46 | #include "curses_private.h" | 46 | #include "curses_private.h" | |
47 | 47 | |||
48 | /* | 48 | /* | |
49 | * ins_wstr -- | 49 | * ins_wstr -- | |
50 | * insert a multi-character wide-character string into the current window | 50 | * insert a multi-character wide-character string into the current window | |
51 | */ | 51 | */ | |
52 | int | 52 | int | |
@@ -86,40 +86,40 @@ mvins_nwstr(int y, int x, const wchar_t | @@ -86,40 +86,40 @@ mvins_nwstr(int y, int x, const wchar_t | |||
86 | return mvwins_nwstr(stdscr, y, x, wstr, n); | 86 | return mvwins_nwstr(stdscr, y, x, wstr, n); | |
87 | } | 87 | } | |
88 | 88 | |||
89 | /* | 89 | /* | |
90 | * mvwins_wstr -- | 90 | * mvwins_wstr -- | |
91 | * Do an insert-string on the line at (y, x) in the given window. | 91 | * Do an insert-string on the line at (y, x) in the given window. | |
92 | */ | 92 | */ | |
93 | int | 93 | int | |
94 | mvwins_wstr(WINDOW *win, int y, int x, const wchar_t *wstr) | 94 | mvwins_wstr(WINDOW *win, int y, int x, const wchar_t *wstr) | |
95 | { | 95 | { | |
96 | if (wmove(win, y, x) == ERR) | 96 | if (wmove(win, y, x) == ERR) | |
97 | return ERR; | 97 | return ERR; | |
98 | 98 | |||
99 | return wins_wstr(stdscr, wstr); | 99 | return wins_wstr(win, wstr); | |
100 | } | 100 | } | |
101 | 101 | |||
102 | /* | 102 | /* | |
103 | * mvwins_nwstr -- | 103 | * mvwins_nwstr -- | |
104 | * Do an insert-n-string on the line at (y, x) in the given window. | 104 | * Do an insert-n-string on the line at (y, x) in the given window. | |
105 | */ | 105 | */ | |
106 | int | 106 | int | |
107 | mvwins_nwstr(WINDOW *win, int y, int x, const wchar_t *wstr, int n) | 107 | mvwins_nwstr(WINDOW *win, int y, int x, const wchar_t *wstr, int n) | |
108 | { | 108 | { | |
109 | if (wmove(win, y, x) == ERR) | 109 | if (wmove(win, y, x) == ERR) | |
110 | return ERR; | 110 | return ERR; | |
111 | 111 | |||
112 | return wins_nwstr(stdscr, wstr, n); | 112 | return wins_nwstr(win, wstr, n); | |
113 | } | 113 | } | |
114 | 114 | |||
115 | 115 | |||
116 | /* | 116 | /* | |
117 | * wins_wstr -- | 117 | * wins_wstr -- | |
118 | * Do an insert-string on the line, leaving (cury, curx) unchanged. | 118 | * Do an insert-string on the line, leaving (cury, curx) unchanged. | |
119 | */ | 119 | */ | |
120 | int | 120 | int | |
121 | wins_wstr(WINDOW *win, const wchar_t *wstr) | 121 | wins_wstr(WINDOW *win, const wchar_t *wstr) | |
122 | { | 122 | { | |
123 | return wins_nwstr(win, wstr, -1); | 123 | return wins_nwstr(win, wstr, -1); | |
124 | } | 124 | } | |
125 | 125 |
--- src/lib/libcurses/insch.c 2019/06/09 07:40:14 1.25
+++ src/lib/libcurses/insch.c 2020/07/07 12:43:51 1.25.2.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: insch.c,v 1.25 2019/06/09 07:40:14 blymn Exp $ */ | 1 | /* $NetBSD: insch.c,v 1.25.2.1 2020/07/07 12:43:51 martin Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1981, 1993, 1994 | 4 | * Copyright (c) 1981, 1993, 1994 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -24,27 +24,27 @@ | @@ -24,27 +24,27 @@ | |||
24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
29 | * SUCH DAMAGE. | 29 | * SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include <sys/cdefs.h> | 32 | #include <sys/cdefs.h> | |
33 | #ifndef lint | 33 | #ifndef lint | |
34 | #if 0 | 34 | #if 0 | |
35 | static char sccsid[] = "@(#)insch.c 8.2 (Berkeley) 5/4/94"; | 35 | static char sccsid[] = "@(#)insch.c 8.2 (Berkeley) 5/4/94"; | |
36 | #else | 36 | #else | |
37 | __RCSID("$NetBSD: insch.c,v 1.25 2019/06/09 07:40:14 blymn Exp $"); | 37 | __RCSID("$NetBSD: insch.c,v 1.25.2.1 2020/07/07 12:43:51 martin Exp $"); | |
38 | #endif | 38 | #endif | |
39 | #endif /* not lint */ | 39 | #endif /* not lint */ | |
40 | 40 | |||
41 | #include <string.h> | 41 | #include <string.h> | |
42 | #include <stdlib.h> | 42 | #include <stdlib.h> | |
43 | 43 | |||
44 | #include "curses.h" | 44 | #include "curses.h" | |
45 | #include "curses_private.h" | 45 | #include "curses_private.h" | |
46 | 46 | |||
47 | #ifndef _CURSES_USE_MACROS | 47 | #ifndef _CURSES_USE_MACROS | |
48 | 48 | |||
49 | /* | 49 | /* | |
50 | * insch -- | 50 | * insch -- | |
@@ -69,27 +69,27 @@ mvinsch(int y, int x, chtype ch) | @@ -69,27 +69,27 @@ mvinsch(int y, int x, chtype ch) | |||
69 | } | 69 | } | |
70 | 70 | |||
71 | /* | 71 | /* | |
72 | * mvwinsch -- | 72 | * mvwinsch -- | |
73 | * Do an insert-char on the line at (y, x) in the given window. | 73 | * Do an insert-char on the line at (y, x) in the given window. | |
74 | */ | 74 | */ | |
75 | int | 75 | int | |
76 | mvwinsch(WINDOW *win, int y, int x, chtype ch) | 76 | mvwinsch(WINDOW *win, int y, int x, chtype ch) | |
77 | { | 77 | { | |
78 | 78 | |||
79 | if (wmove(win, y, x) == ERR) | 79 | if (wmove(win, y, x) == ERR) | |
80 | return ERR; | 80 | return ERR; | |
81 | 81 | |||
82 | return winsch(stdscr, ch); | 82 | return winsch(win, ch); | |
83 | } | 83 | } | |
84 | 84 | |||
85 | #endif | 85 | #endif | |
86 | 86 | |||
87 | /* | 87 | /* | |
88 | * winsch -- | 88 | * winsch -- | |
89 | * Do an insert-char on the line, leaving (cury, curx) unchanged. | 89 | * Do an insert-char on the line, leaving (cury, curx) unchanged. | |
90 | */ | 90 | */ | |
91 | int | 91 | int | |
92 | winsch(WINDOW *win, chtype ch) | 92 | winsch(WINDOW *win, chtype ch) | |
93 | { | 93 | { | |
94 | __LDATA *end, *temp1, *temp2; | 94 | __LDATA *end, *temp1, *temp2; | |
95 | attr_t attr; | 95 | attr_t attr; |
--- src/lib/libcurses/insstr.c 2019/06/09 07:40:14 1.7
+++ src/lib/libcurses/insstr.c 2020/07/07 12:43:51 1.7.2.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: insstr.c,v 1.7 2019/06/09 07:40:14 blymn Exp $ */ | 1 | /* $NetBSD: insstr.c,v 1.7.2.1 2020/07/07 12:43:51 martin Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2005 The NetBSD Foundation Inc. | 4 | * Copyright (c) 2005 The NetBSD Foundation Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from code donated to the NetBSD Foundation | 7 | * This code is derived from code donated to the NetBSD Foundation | |
8 | * by Ruibiao Qiu <ruibiao@arl.wustl.edu,ruibiao@gmail.com>. | 8 | * by Ruibiao Qiu <ruibiao@arl.wustl.edu,ruibiao@gmail.com>. | |
9 | * | 9 | * | |
10 | * | 10 | * | |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without | |
12 | * modification, are permitted provided that the following conditions | 12 | * modification, are permitted provided that the following conditions | |
13 | * are met: | 13 | * are met: | |
14 | * 1. Redistributions of source code must retain the above copyright | 14 | * 1. Redistributions of source code must retain the above copyright | |
@@ -26,27 +26,27 @@ | @@ -26,27 +26,27 @@ | |||
26 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 26 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
30 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 30 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
31 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 31 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
34 | * SUCH DAMAGE. | 34 | * SUCH DAMAGE. | |
35 | */ | 35 | */ | |
36 | 36 | |||
37 | #include <sys/cdefs.h> | 37 | #include <sys/cdefs.h> | |
38 | #ifndef lint | 38 | #ifndef lint | |
39 | __RCSID("$NetBSD: insstr.c,v 1.7 2019/06/09 07:40:14 blymn Exp $"); | 39 | __RCSID("$NetBSD: insstr.c,v 1.7.2.1 2020/07/07 12:43:51 martin Exp $"); | |
40 | #endif /* not lint */ | 40 | #endif /* not lint */ | |
41 | 41 | |||
42 | #include <string.h> | 42 | #include <string.h> | |
43 | #include <stdlib.h> | 43 | #include <stdlib.h> | |
44 | 44 | |||
45 | #include "curses.h" | 45 | #include "curses.h" | |
46 | #include "curses_private.h" | 46 | #include "curses_private.h" | |
47 | 47 | |||
48 | #ifndef _CURSES_USE_MACROS | 48 | #ifndef _CURSES_USE_MACROS | |
49 | 49 | |||
50 | /* | 50 | /* | |
51 | * insstr -- | 51 | * insstr -- | |
52 | * insert a multi-byte character string into the current window | 52 | * insert a multi-byte character string into the current window | |
@@ -93,41 +93,41 @@ mvinsnstr(int y, int x, const char *str, | @@ -93,41 +93,41 @@ mvinsnstr(int y, int x, const char *str, | |||
93 | } | 93 | } | |
94 | 94 | |||
95 | /* | 95 | /* | |
96 | * mvwinsstr -- | 96 | * mvwinsstr -- | |
97 | * Do an insert-string on the line at (y, x) in the given window. | 97 | * Do an insert-string on the line at (y, x) in the given window. | |
98 | */ | 98 | */ | |
99 | int | 99 | int | |
100 | mvwinsstr(WINDOW *win, int y, int x, const char *str) | 100 | mvwinsstr(WINDOW *win, int y, int x, const char *str) | |
101 | { | 101 | { | |
102 | 102 | |||
103 | if (wmove(win, y, x) == ERR) | 103 | if (wmove(win, y, x) == ERR) | |
104 | return ERR; | 104 | return ERR; | |
105 | 105 | |||
106 | return winsstr(stdscr, str); | 106 | return winsstr(win, str); | |
107 | } | 107 | } | |
108 | 108 | |||
109 | /* | 109 | /* | |
110 | * mvwinsnstr -- | 110 | * mvwinsnstr -- | |
111 | * Do an insert-n-string on the line at (y, x) in the given window. | 111 | * Do an insert-n-string on the line at (y, x) in the given window. | |
112 | */ | 112 | */ | |
113 | int | 113 | int | |
114 | mvwinsnstr(WINDOW *win, int y, int x, const char *str, int n) | 114 | mvwinsnstr(WINDOW *win, int y, int x, const char *str, int n) | |
115 | { | 115 | { | |
116 | 116 | |||
117 | if (wmove(win, y, x) == ERR) | 117 | if (wmove(win, y, x) == ERR) | |
118 | return ERR; | 118 | return ERR; | |
119 | 119 | |||
120 | return winsnstr(stdscr, str, n); | 120 | return winsnstr(win, str, n); | |
121 | } | 121 | } | |
122 | 122 | |||
123 | #endif | 123 | #endif | |
124 | 124 | |||
125 | /* | 125 | /* | |
126 | * winsstr -- | 126 | * winsstr -- | |
127 | * Do an insert-string on the line, leaving (cury, curx) unchanged. | 127 | * Do an insert-string on the line, leaving (cury, curx) unchanged. | |
128 | * No wrapping. | 128 | * No wrapping. | |
129 | */ | 129 | */ | |
130 | int | 130 | int | |
131 | winsstr(WINDOW *win, const char *str) | 131 | winsstr(WINDOW *win, const char *str) | |
132 | { | 132 | { | |
133 | 133 |