pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
pkg/58815: sl(1): make it work with NetBSD curses
>Number: 58815
>Category: pkg
>Synopsis: sl(1): make it work with NetBSD curses
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Nov 07 07:20:01 +0000 2024
>Originator: RVP
>Release: NetBSD/amd64 10.99.12
>Organization:
>Environment:
NetBSD/amd64 10.99.12
>Description:
Make sl(1) work properly with NetBSD curses.
1. Put the terminal into a known state with cbreak() for nodelay(TRUE)
to have the correct effect on getch().
(from: https://github.com/mtoyoda/sl/pull/63)
2. Link against curses.
(from: https://github.com/mtoyoda/sl/pull/64)
3. Don't write chars. exceeding screen-width.
>How-To-Repeat:
Install and run games/sl.
>Fix:
This is for the master version on GitHub.
--START patch--
diff -urN sl-master.orig/Makefile sl-master/Makefile
--- sl-master.orig/Makefile 2017-04-20 08:24:22.000000000 +0000
+++ sl-master/Makefile 2024-11-07 06:39:12.477664819 +0000
@@ -12,7 +12,7 @@
all: sl
sl: sl.c sl.h
- $(CC) $(CFLAGS) -o sl sl.c -lncurses
+ $(CC) $(CFLAGS) -o sl sl.c -lcurses
clean:
rm -f sl
diff -urN sl-master.orig/sl.c sl-master/sl.c
--- sl-master.orig/sl.c 2017-04-20 08:24:22.000000000 +0000
+++ sl-master/sl.c 2024-11-07 06:51:06.660971774 +0000
@@ -60,7 +60,7 @@
{
for ( ; x < 0; ++x, ++str)
if (*str == '\0') return ERR;
- for ( ; *str != '\0'; ++str, ++x)
+ for ( ; *str != '\0' && x < COLS; ++str, ++x)
if (mvaddch(y, x, *str) == ERR) return ERR;
return OK;
}
@@ -91,6 +91,7 @@
}
initscr();
signal(SIGINT, SIG_IGN);
+ cbreak();
noecho();
curs_set(0);
nodelay(stdscr, TRUE);
--END patch--
Home |
Main Index |
Thread Index |
Old Index