NetBSD Problem Report #58815
From www@netbsd.org Thu Nov 7 07:16:17 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
client-signature RSA-PSS (2048 bits) client-digest SHA256)
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 96DB81A9238
for <gnats-bugs@gnats.NetBSD.org>; Thu, 7 Nov 2024 07:16:17 +0000 (UTC)
Message-Id: <20241107071616.354E41A923B@mollari.NetBSD.org>
Date: Thu, 7 Nov 2024 07:16:16 +0000 (UTC)
From: rvp@SDF.ORG
Reply-To: rvp@SDF.ORG
To: gnats-bugs@NetBSD.org
Subject: sl(1): make it work with NetBSD curses
X-Send-Pr-Version: www-1.0
>Number: 58815
>Category: pkg
>Synopsis: sl(1): make it work with NetBSD curses
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bsiegert
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Nov 07 07:20:01 +0000 2024
>Closed-Date: Sun Nov 10 16:24:29 +0000 2024
>Last-Modified: Sun Nov 10 16:25:02 +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--
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: pkg-manager->bsiegert
Responsible-Changed-By: bsiegert@NetBSD.org
Responsible-Changed-When: Sun, 10 Nov 2024 15:52:01 +0000
Responsible-Changed-Why:
take
State-Changed-From-To: open->closed
State-Changed-By: bsiegert@NetBSD.org
State-Changed-When: Sun, 10 Nov 2024 16:24:29 +0000
State-Changed-Why:
Patch committed, thanks!
From: "Benny Siegert" <bsiegert@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/58815 CVS commit: pkgsrc/games/sl
Date: Sun, 10 Nov 2024 16:23:49 +0000
Module Name: pkgsrc
Committed By: bsiegert
Date: Sun Nov 10 16:23:49 UTC 2024
Modified Files:
pkgsrc/games/sl: Makefile distinfo
pkgsrc/games/sl/patches: patch-Makefile
Added Files:
pkgsrc/games/sl/patches: patch-sl.c
Log Message:
sl: bugfixes for use with NetBSD curses
Bump revision.
From RVP in PR pkg/58815.
To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 pkgsrc/games/sl/Makefile
cvs rdiff -u -r1.10 -r1.11 pkgsrc/games/sl/distinfo
cvs rdiff -u -r1.1 -r1.2 pkgsrc/games/sl/patches/patch-Makefile
cvs rdiff -u -r0 -r1.1 pkgsrc/games/sl/patches/patch-sl.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.