diff options
| author | Michael Forney <mforney@mforney.org> | 2021-05-30 00:47:43 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2021-06-03 01:04:37 -0700 |
| commit | 8957ea66ba0f027b9e810dab7725341f07359e37 (patch) | |
| tree | fba58cf1c4c9623172d559b406cf273256f02813 /pkg/netbsd-curses/patch | |
| parent | eebd8aa52002de6977bc72a1213a2e93cd3a5f00 (diff) | |
Add netbsd-curses
Diffstat (limited to 'pkg/netbsd-curses/patch')
4 files changed, 176 insertions, 0 deletions
diff --git a/pkg/netbsd-curses/patch/0001-Use-__fpurge-from-stdio_ext.h.patch b/pkg/netbsd-curses/patch/0001-Use-__fpurge-from-stdio_ext.h.patch new file mode 100644 index 00000000..db9315ae --- /dev/null +++ b/pkg/netbsd-curses/patch/0001-Use-__fpurge-from-stdio_ext.h.patch @@ -0,0 +1,33 @@ +From 9c2c3bd4d21bf5f55c2e8a41c8253d152f7ba2f5 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sat, 29 May 2021 21:45:58 -0700 +Subject: [PATCH] Use __fpurge from stdio_ext.h + +--- + lib/libcurses/tty.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/lib/libcurses/tty.c b/lib/libcurses/tty.c +index b022ba6..b5e4506 100644 +--- a/lib/libcurses/tty.c ++++ b/lib/libcurses/tty.c +@@ -34,6 +34,7 @@ + #include <sys/types.h> + + #include <fcntl.h> ++#include <stdio_ext.h> + #include <stdlib.h> + #include <termios.h> + #include <unistd.h> +@@ -597,7 +598,7 @@ int + flushinp(void) + { + +- (void)fpurge(_cursesi_screen->infd); ++ (void)__fpurge(_cursesi_screen->infd); + return OK; + } + +-- +2.31.1 + diff --git a/pkg/netbsd-curses/patch/0002-Remove-duplicate-keymap-sequences-from-st-terminfo.patch b/pkg/netbsd-curses/patch/0002-Remove-duplicate-keymap-sequences-from-st-terminfo.patch new file mode 100644 index 00000000..61112418 --- /dev/null +++ b/pkg/netbsd-curses/patch/0002-Remove-duplicate-keymap-sequences-from-st-terminfo.patch @@ -0,0 +1,50 @@ +From a6d5710b0fa7d79da7addc1ba2f58b28d6823396 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Tue, 1 Jun 2021 00:24:45 -0700 +Subject: [PATCH] Remove duplicate keymap sequences from st terminfo + +Otherwise, curses has to make an arbitrary decision about which key +to use when that sequence is detected. +--- + share/terminfo/terminfo | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/share/terminfo/terminfo b/share/terminfo/terminfo +index b70fa1c..6e1f3bb 100644 +--- a/share/terminfo/terminfo ++++ b/share/terminfo/terminfo +@@ -1398,7 +1398,7 @@ qansi-g|QNX ANSI, + ind=\E[S, invis=\E[9m, + is2=\E>\E[?1l\E[?7h\E[0;10;39;49m, is3=\E(B\E)0, + kBEG=\ENn, kCAN=\E[s, kCMD=\E[t, kCPY=\ENs, kCRT=\ENt, +- kDL=\ENv, kEXT=\ENw, kFND=\ENx, kHLP=\ENy, kHOM=\E[h, ++ kEXT=\ENw, kFND=\ENx, kHLP=\ENy, kHOM=\E[h, + kLFT=\E[d, kNXT=\E[u, kOPT=\ENz, kPRV=\E[v, kRIT=\E[c, + kbs=^H, kcan=\E[S, kcbt=\E[Z, kclo=\ENc, kclr=\ENa, + kcmd=\E[G, kcpy=\E[g, kctab=\E[z, kcub1=\E[D, kcud1=\E[B, +@@ -6701,10 +6701,10 @@ st-0.6|simpleterm 0.6, + il=\E[%p1%dL, il1=\E[L, ind=\n, invis=\E[8m, + is2=\E[4l\E>\E[?1034l, kDC=\E[3;2~, kEND=\E[1;2F, + kHOM=\E[1;2H, kIC=\E[2;2~, kLFT=\E[1;2D, kNXT=\E[6;2~, +- kPRV=\E[5;2~, kRIT=\E[1;2C, ka1=\E[1~, ka3=\E[5~, kb2=\EOu, +- kbs=^?, kc1=\E[4~, kc3=\E[6~, kcbt=\E[Z, kclr=\E[3;5~, ++ kPRV=\E[5;2~, kRIT=\E[1;2C, kb2=\EOu, ++ kbs=^?, kcbt=\E[Z, kclr=\E[3;5~, + kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, +- kdch1=\E[3~, kdl1=\E[3;2~, ked=\E[1;5F, kel=\E[1;2F, ++ kdch1=\E[3~, kdl1=\E[3;2~, ked=\E[1;5F, + kend=\E[4~, kent=\EOM, kf1=\EOP, kf10=\E[21~, kf11=\E[23~, + kf12=\E[24~, kf13=\E[1;2P, kf14=\E[1;2Q, kf15=\E[1;2R, + kf16=\E[1;2S, kf17=\E[15;2~, kf18=\E[17;2~, +@@ -6724,7 +6724,7 @@ st-0.6|simpleterm 0.6, + kf61=\E[1;4P, kf62=\E[1;4Q, kf63=\E[1;4R, kf7=\E[18~, + kf8=\E[19~, kf9=\E[20~, khome=\E[1~, kich1=\E[2~, + kil1=\E[2;5~, kind=\E[1;2B, kmous=\E[M, knp=\E[6~, +- kpp=\E[5~, kri=\E[1;2A, krmir=\E[2;2~, mc0=\E[i, mc4=\E[4i, ++ kpp=\E[5~, kri=\E[1;2A, mc0=\E[i, mc4=\E[4i, + mc5=\E[5i, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, + rmacs=\E(B, rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[27m, + rmul=\E[24m, rs1=\Ec, rs2=\E[4l\E>\E[?1034l, sc=\E7, +-- +2.31.1 + diff --git a/pkg/netbsd-curses/patch/0003-Don-t-wrap-when-adding-past-last-line-in-non-scrolli.patch b/pkg/netbsd-curses/patch/0003-Don-t-wrap-when-adding-past-last-line-in-non-scrolli.patch new file mode 100644 index 00000000..4ea2e85e --- /dev/null +++ b/pkg/netbsd-curses/patch/0003-Don-t-wrap-when-adding-past-last-line-in-non-scrolli.patch @@ -0,0 +1,65 @@ +From 5b5cbce58a6ff85174abbdf57ba56db501fe816d Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Thu, 3 Jun 2021 00:32:57 -0700 +Subject: [PATCH] Don't wrap when adding past last line in non-scrolling window + +X/Open curses says + +> If scrolling is disabled, any characters that would extend beyond +> the last column of the last line are truncated. + +However, currently libcurses wraps the cursor back to the beginning +of the last line. + +To fix this, when we try to add a character that would go past the +end of the last line, leave the cursor where it is. If the character +goes exactly to the end of the last line, add the character but set +the cursor to the last column (to match ncurses behavior). + +[0] https://pubs.opengroup.org/onlinepubs/7908799/xcurses/intov.html#tag_001_004_002_002 +--- + lib/libcurses/addbytes.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/lib/libcurses/addbytes.c b/lib/libcurses/addbytes.c +index 9fd917c..7f88487 100644 +--- a/lib/libcurses/addbytes.c ++++ b/lib/libcurses/addbytes.c +@@ -459,7 +459,6 @@ _cursesi_addwchar(WINDOW *win, __LINE **lnp, int *y, int *x, + if (newx > *(*lnp)->lastchp) + *(*lnp)->lastchp = newx; + __touchline(win, *y, sx, (int) win->maxx - 1); +- sx = *x = 0; + if (*y == win->scr_b) { + if (!(win->flags & __SCROLLOK)) + return ERR; +@@ -467,6 +466,7 @@ _cursesi_addwchar(WINDOW *win, __LINE **lnp, int *y, int *x, + } else { + (*y)++; + } ++ sx = *x = 0; + lp = &win->alines[*y]->line[0]; + (*lnp) = win->alines[*y]; + } +@@ -547,14 +547,16 @@ _cursesi_addwchar(WINDOW *win, __LINE **lnp, int *y, int *x, + if (newx > *(*lnp)->lastchp) + *(*lnp)->lastchp = newx; + __touchline(win, *y, sx, (int) win->maxx - 1); +- *x = sx = 0; + if (*y == win->scr_b) { +- if (!(win->flags & __SCROLLOK)) ++ if (!(win->flags & __SCROLLOK)) { ++ *x = win->maxx - 1; + return ERR; ++ } + scroll(win); + } else { + (*y)++; + } ++ *x = sx = 0; + lp = &win->alines[*y]->line[0]; + (*lnp) = win->alines[*y]; + } else { +-- +2.31.1 + diff --git a/pkg/netbsd-curses/patch/0004-Return-early-from-_cursesi_waddbytes-if-_cursesi_add.patch b/pkg/netbsd-curses/patch/0004-Return-early-from-_cursesi_waddbytes-if-_cursesi_add.patch new file mode 100644 index 00000000..8d62f0fb --- /dev/null +++ b/pkg/netbsd-curses/patch/0004-Return-early-from-_cursesi_waddbytes-if-_cursesi_add.patch @@ -0,0 +1,28 @@ +From afe19e9450015024e51f3e694c866fc1e1c20c8f Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Thu, 3 Jun 2021 00:42:45 -0700 +Subject: [PATCH] Return early from _cursesi_waddbytes if _cursesi_addwchar + fails + +This error may indicate that scrolling was required in a non-scrolling +window, in which case the rest of the string should be truncated. +--- + lib/libcurses/addbytes.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/libcurses/addbytes.c b/lib/libcurses/addbytes.c +index 7f88487..6d50bdf 100644 +--- a/lib/libcurses/addbytes.c ++++ b/lib/libcurses/addbytes.c +@@ -132,7 +132,7 @@ _cursesi_waddbytes(WINDOW *win, const char *bytes, int count, attr_t attr, + #ifdef HAVE_WCHAR + (void)memset(&st, 0, sizeof(st)); + #endif +- while (count > 0) { ++ while (count > 0 && err == OK) { + #ifndef HAVE_WCHAR + c = *bytes++; + #ifdef DEBUG +-- +2.31.1 + |
