pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

edbrowse: Update edbrowse to version 3.8.15



Module Name:	pkgsrc-wip
Committed By:	adr <adr%sdf.org@localhost>
Pushed By:	adr
Date:		Fri Nov 20 16:04:00 2026 +0000
Changeset:	7574f788c6fb756b582d1fe2b0da9307bd182584

Added Files:
	edbrowse/COMMIT_MSG
	edbrowse/DESCR
	edbrowse/Makefile
	edbrowse/PLIST
	edbrowse/distinfo
	edbrowse/patches/patch-src_html.c
	eflite/COMMIT_MSG
	eflite/DESCR
	eflite/Makefile
	eflite/PLIST
	eflite/distinfo
	eflite/patches/patch-Makefile.in
	eflite/patches/patch-fs.c
	eflite/patches/patch-soccon.c
	eflite/patches/patch-sockopen.c
	yasr/COMMIT_MSG
	yasr/DESCR
	yasr/Makefile
	yasr/PLIST
	yasr/distinfo
	yasr/patches/patch-meson.build
	yasr/patches/patch-yasr_main.c
	yasr/patches/patch-yasr_tts.c
	yasr/patches/patch-yasr_yasr.h

Log Message:
edbrowse: Update edbrowse to version 3.8.15

Packaging changes:
	Migrate to quickjs-ng

Upstream changes:
	The lsr and lsc commands.
	Migrate from quickjs to quickjs-ng.
	Rerender quickly after browse then throttle back to the rr_interval.

eflite: Update eflite to version 0.0.0.91

Upstream changes:
    Keep the audio device open
    Fix build with gcc 15
    0xa0 is a hard space
    Fix the dictionary of high ASCII characters
    Run autoupdate

yasr: Update yasr to version 0.0.0.156

Packaging changes:
	Update patches
	Change license

Upstream changes:
    First pass at porting to MacOS
    Re-license under the GNU Lesser General Public License v2.1
    meson: Link with libintl when needed
    meson: Check for util.h
    meson: Add Homebrew include directory on MacOS
    Parse OSC sequences
    win_csi: Ignore intermediate characters
    Update yasr.conf to account for "special" being deleted
    Add a "silent window" key binding
    Allow restricting speech to a particular region of the screen
    Fix build with speech-dispatcher disabled
    Fix a prototype
	# Please enter the commit message for your changes. Lines starting
	# with '#' will be ignored, and an empty message aborts the commit.
	#
	# On branch master
	# Your branch is up to date with 'origin/master'.
	#
	# Changes to be committed:
	#	new file:   edbrowse/COMMIT_MSG
	#	new file:   edbrowse/DESCR
	#	new file:   edbrowse/Makefile
	#	new file:   edbrowse/PLIST
	#	new file:   edbrowse/distinfo
	#	new file:   edbrowse/patches/patch-src_html.c
	#	new file:   eflite/COMMIT_MSG
	#	new file:   eflite/DESCR
	#	new file:   eflite/Makefile
	#	new file:   eflite/PLIST
	#	new file:   eflite/distinfo
	#	new file:   eflite/patches/patch-Makefile.in
	#	new file:   eflite/patches/patch-fs.c
	#	new file:   eflite/patches/patch-soccon.c
	#	new file:   eflite/patches/patch-sockopen.c
	#	new file:   yasr/COMMIT_MSG
	#	new file:   yasr/DESCR
	#	new file:   yasr/Makefile
	#	new file:   yasr/PLIST
	#	new file:   yasr/distinfo
	#	new file:   yasr/patches/patch-meson.build
	#	new file:   yasr/patches/patch-yasr_main.c
	#	new file:   yasr/patches/patch-yasr_tts.c
	#	new file:   yasr/patches/patch-yasr_yasr.h
	#
	# Untracked files:
	#	elinks/
	#

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=7574f788c6fb756b582d1fe2b0da9307bd182584

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 edbrowse/COMMIT_MSG               |   15 +
 edbrowse/DESCR                    |    4 +
 edbrowse/Makefile                 |   60 +++
 edbrowse/PLIST                    |    5 +
 edbrowse/distinfo                 |    6 +
 edbrowse/patches/patch-src_html.c |   16 +
 eflite/COMMIT_MSG                 |   13 +
 eflite/DESCR                      |    2 +
 eflite/Makefile                   |   28 +
 eflite/PLIST                      |    2 +
 eflite/distinfo                   |    9 +
 eflite/patches/patch-Makefile.in  |   36 ++
 eflite/patches/patch-fs.c         |   15 +
 eflite/patches/patch-soccon.c     |   16 +
 eflite/patches/patch-sockopen.c   |   16 +
 yasr/COMMIT_MSG                   |   26 +
 yasr/DESCR                        |    7 +
 yasr/Makefile                     |   33 ++
 yasr/PLIST                        |    6 +
 yasr/distinfo                     |    9 +
 yasr/patches/patch-meson.build    |   15 +
 yasr/patches/patch-yasr_main.c    | 1072 +++++++++++++++++++++++++++++++++++++
 yasr/patches/patch-yasr_tts.c     |  492 +++++++++++++++++
 yasr/patches/patch-yasr_yasr.h    |   39 ++
 24 files changed, 1942 insertions(+)

diffs:
diff --git a/edbrowse/COMMIT_MSG b/edbrowse/COMMIT_MSG
new file mode 100644
index 0000000000..f3335aaa10
--- /dev/null
+++ b/edbrowse/COMMIT_MSG
@@ -0,0 +1,15 @@
+www/edbrowse: Update edbrowse to version 3.8.15
+
+Update prepared in wip by adr
+
+Migrate to quickjs-ng.
+
+3.8.15
+
+The lsr and lsc commands.
+
+Migrate from quickjs to quickjs-ng.
+The latter is preferred by most distributions, but we support both.
+Use flags at build time to switch between the two. See README.
+
+Rerender quickly after browse then throttle back to the rr_interval.
diff --git a/edbrowse/DESCR b/edbrowse/DESCR
new file mode 100644
index 0000000000..39bb887f64
--- /dev/null
+++ b/edbrowse/DESCR
@@ -0,0 +1,4 @@
+Edbrowse is a combination editor, browser, and mail client that is 100%
+text based. The interface is similar to /bin/ed, though there are many
+more features, such as editing multiple files simultaneously, and
+rendering html.
diff --git a/edbrowse/Makefile b/edbrowse/Makefile
new file mode 100644
index 0000000000..0f9020a710
--- /dev/null
+++ b/edbrowse/Makefile
@@ -0,0 +1,60 @@
+# $NetBSD: Makefile,v 1.8 2026/11/11 11:56:14 wiz Exp $
+
+DISTNAME=	edbrowse-3.8.15
+CATEGORIES=	www
+MASTER_SITES=	${MASTER_SITE_GITHUB:=CMB/}
+GITHUB_TAG=	v${PKGVERSION_NOREV}
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://edbrowse.org/
+COMMENT=	Command Line Editor & Browser
+LICENSE=	gnu-gpl-v2 AND mit
+
+USE_TOOLS+=	gmake perl:build
+USE_LANGUAGES=	c c++
+
+NO_CONFIGURE=	yes
+
+SUBST_CLASSES+=		man
+SUBST_STAGE.man=	post-extract
+SUBST_MESSAGE.man=	Fixing paths in man page
+SUBST_FILES.man=	doc/*.1
+SUBST_SED.man=		-e '/usersguide\.html/ s,/usr,${PREFIX},g'
+
+MAKE_FILE=		makefile
+
+PTHREAD_AUTO_VARS=	yes
+PTHREAD_OPTS=		require
+
+BUILDLINK_TRANSFORM+=	rm:-lpthread rm:-Wall \
+			opt:-ldl:${BUILDLINK_LDADD.dl:Q} \
+			opt:-lopenssl:${BUILDLINK_LDADD.openssl:Q}
+
+MAKE_FLAGS+=		QUICKJS_PKG=quickjs-ng
+
+EGDIR=			share/examples/${PKGBASE}
+DOCDIR=			share/doc/${PKGBASE}
+
+AUTO_MKDIRS=		yes
+
+do-install:
+	${INSTALL_MAN} ${WRKSRC}/doc/man-edbrowse-freebsd.1 \
+		${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/${PKGBASE}.1
+	${INSTALL_PROGRAM} ${WRKSRC}/src/edbrowse	\
+		${DESTDIR}${PREFIX}/bin
+
+post-install:
+	${INSTALL_DATA} ${WRKSRC}/doc/sample.ebrc	\
+		${DESTDIR}${PREFIX}/${EGDIR}
+	${INSTALL_DATA} ${WRKSRC}/doc/usersguide.html	\
+		${DESTDIR}${PREFIX}/${DOCDIR}
+
+.include "../../databases/unixodbc/buildlink3.mk"
+.include "../../security/openssl/buildlink3.mk"
+.include "../../lang/quickjs-ng/buildlink3.mk"
+.include "../../devel/pcre2/buildlink3.mk"
+.include "../../www/curl/buildlink3.mk"
+.include "../../mk/readline.buildlink3.mk"
+.include "../../mk/dlopen.buildlink3.mk"
+.include "../../mk/pthread.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/edbrowse/PLIST b/edbrowse/PLIST
new file mode 100644
index 0000000000..8781558e9e
--- /dev/null
+++ b/edbrowse/PLIST
@@ -0,0 +1,5 @@
+@comment $NetBSD: PLIST,v 1.1 2025/12/08 07:25:21 vins Exp $
+bin/edbrowse
+man/man1/edbrowse.1
+share/doc/edbrowse/usersguide.html
+share/examples/edbrowse/sample.ebrc
diff --git a/edbrowse/distinfo b/edbrowse/distinfo
new file mode 100644
index 0000000000..57cc0c4066
--- /dev/null
+++ b/edbrowse/distinfo
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.1 2025/12/08 07:25:22 vins Exp $
+
+BLAKE2s (edbrowse-3.8.15.tar.gz) = 50ba4d2896df378540db13cc3f3dc3ddd76b89578fe4f3ecaf7f3a668794e956
+SHA512 (edbrowse-3.8.15.tar.gz) = 9dbccf389ffa9aaf16cfb1000e768dcd94b19bf18384b248db8480464d6a69d7972d524f987cf20e9c459c1d78d9062568f78556bc6e6a4517f81631d10a5fd5
+Size (edbrowse-3.8.15.tar.gz) = 1099530 bytes
+SHA1 (patch-src_html.c) = 07e2ce6813d5a1eff3a0b89585cea33ffdd2a839
diff --git a/edbrowse/patches/patch-src_html.c b/edbrowse/patches/patch-src_html.c
new file mode 100644
index 0000000000..00fad56809
--- /dev/null
+++ b/edbrowse/patches/patch-src_html.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-src_html.c,v 1.1 2025/12/08 07:25:22 vins Exp $
+
+pthread_tryjoin_np is a GNUism.
+https://www.gnu.org/software/gnulib/manual/html_node/pthread_005ftryjoin_005fnp.html
+
+--- src/html.c.orig	2025-11-09 16:04:36.000000000 +0000
++++ src/html.c
+@@ -11,7 +11,7 @@ extern int gettimeofday(struct timeval *
+ 
+ // OSX has no pthread_tryjoin_np, so we can't do our
+ // asynchronous timers under OSX, which is really no great loss.
+-#if defined(__APPLE__) || defined(__ANDROID__) || defined(__FreeBSD__)
++#if !defined(___GNU_SOURCE)
+ #define pthread_tryjoin_np pthread_join
+ #endif
+ 
diff --git a/eflite/COMMIT_MSG b/eflite/COMMIT_MSG
new file mode 100644
index 0000000000..61c877e42a
--- /dev/null
+++ b/eflite/COMMIT_MSG
@@ -0,0 +1,13 @@
+audio/eflite: Update eflite to version 0.0.0.91
+
+Update prepared in wip by adr
+
+Commits on Apr 15, 2025
+    Keep the audio device open
+Commits on Feb 17, 2025
+    Fix build with gcc 15
+Commits on Jul 22, 2024
+    0xa0 is a hard space
+Commits on Jul 13, 2024
+    Fix the dictionary of high ASCII characters
+    Run autoupdate
diff --git a/eflite/DESCR b/eflite/DESCR
new file mode 100644
index 0000000000..b1a7c4b849
--- /dev/null
+++ b/eflite/DESCR
@@ -0,0 +1,2 @@
+Eflite is a speech server which allows screen readers like Emacspeak
+or Yasrs to interact with the speech sinthesizer Flite.
diff --git a/eflite/Makefile b/eflite/Makefile
new file mode 100644
index 0000000000..83c3bf809a
--- /dev/null
+++ b/eflite/Makefile
@@ -0,0 +1,28 @@
+# $NetBSD: Makefile,v 1.1 2024/02/25 22:00:09 wiz Exp $
+
+COMMITS=	91
+DISTNAME=	eflite-0.0.0.${COMMITS}
+CATEGORIES=	audio
+MASTER_SITES=	${MASTER_SITE_GITHUB:=mgorse/}
+GITHUB_TAG=	9cd004236fdc3cfcd0a7a8c8acb322e84595514c
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://github.com/mgorse/eflite
+COMMENT=	Speech server for screen readers using Festival Lite
+LICENSE=	gnu-gpl-v2
+
+USE_LANGUAGES=		c
+USE_TOOLS=		gmake autoconf automake autoreconf
+GNU_CONFIGURE=		yes
+
+CONFIGURE_ARGS+=	CFLAGS="${CFLAGS} -DDO_WAVE_CANCEL"
+CONFIGURE_ARGS+=	LDFLAGS="${LDFLAGS}"
+CONFIGURE_ARGS+=	DESTDIR="${DESTDIR}"
+
+BUILD_TARGET=		eflite
+
+pre-configure:
+	set -e; cd ${WRKSRC} && autoreconf -fi
+
+.include "../../audio/flite/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/eflite/PLIST b/eflite/PLIST
new file mode 100644
index 0000000000..6de2164a42
--- /dev/null
+++ b/eflite/PLIST
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST,v 1.1 2024/02/25 22:00:09 wiz Exp $
+bin/eflite
diff --git a/eflite/distinfo b/eflite/distinfo
new file mode 100644
index 0000000000..b5c3f6e93b
--- /dev/null
+++ b/eflite/distinfo
@@ -0,0 +1,9 @@
+$NetBSD: distinfo,v 1.1 2024/02/25 22:00:09 wiz Exp $
+
+BLAKE2s (eflite-0.0.0.91-9cd004236fdc3cfcd0a7a8c8acb322e84595514c.tar.gz) = 705eeb0e774ff1762fe023464a53d171632beddd17baf04cf5e8d9968ed62aa0
+SHA512 (eflite-0.0.0.91-9cd004236fdc3cfcd0a7a8c8acb322e84595514c.tar.gz) = d705e627e884542642eabc0f360df053ec57b28e4c276dcbee26f5e17ac24ad44ae6f50935d30e12aaa234f3ce0831ff1abf2c076592e5a2eeea593a6947a2de
+Size (eflite-0.0.0.91-9cd004236fdc3cfcd0a7a8c8acb322e84595514c.tar.gz) = 32109 bytes
+SHA1 (patch-Makefile.in) = f77c612548471c3465860afc9568426ee5faaca8
+SHA1 (patch-fs.c) = 21dc050709e9038b74159a4d614dac4b462eaf06
+SHA1 (patch-soccon.c) = 33074b1d582738919e7df5a735e204f2aefdfb90
+SHA1 (patch-sockopen.c) = 750cb4431307c182692a0a59e105c5be8e32e539
diff --git a/eflite/patches/patch-Makefile.in b/eflite/patches/patch-Makefile.in
new file mode 100644
index 0000000000..6387235580
--- /dev/null
+++ b/eflite/patches/patch-Makefile.in
@@ -0,0 +1,36 @@
+$NetBSD: patch-Makefile.in,v 1.1 2024/02/25 22:00:09 wiz Exp $
+
+Add DEFS to CFLAGS (for string.h)
+Use DESTDIR in install target
+
+--- Makefile.in.orig	2024-01-14 23:55:06.000000000 +0000
++++ Makefile.in
+@@ -4,7 +4,7 @@
+ # Do not hand edit.
+ 
+ CC       = @CC@
+-CFLAGS   = @CFLAGS@
++CFLAGS   = @CFLAGS@ @DEFS@
+ CPPFLAGS = @CPPFLAGS@
+ DEFS     = @DEFS@
+ LDFLAGS   = @LDFLAGS@
+@@ -18,8 +18,8 @@ FL_LEX   = @FL_LEX@
+ exec_prefix   = @exec_prefix@
+ prefix        = @prefix@
+ EXEEXT	      = @EXEEXT@
+-INSTALLBINDIR = @bindir@
+-INSTALLLIBDIR = @libdir@
++INSTALLBINDIR = $(DESTDIR)/@bindir@
++INSTALLLIBDIR = $(DESTDIR)@libdir@
+ 
+ #CFLAGS+= -DDEBUG=2
+ #CFLAGS+= -DDO_WAVE_CANCEL
+@@ -52,7 +52,7 @@ ifneq (,$(wildcard *.o))
+ endif
+ 
+ install: eflite
+-	mkdir -p $(exec_prefix)/bin && install -c -m 0755 $< $(exec_prefix)/bin
++	mkdir -p $(INSTALLBINDIR) && install -c -m 0755 $< $(INSTALLBINDIR)
+ 
+ test: eflite
+ 	./eflite -f eflite_test.txt
diff --git a/eflite/patches/patch-fs.c b/eflite/patches/patch-fs.c
new file mode 100644
index 0000000000..bebaa145c3
--- /dev/null
+++ b/eflite/patches/patch-fs.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-fs.c,v 1.1 2024/02/25 22:00:09 wiz Exp $
+
+Remove useless operator (typo)
+
+--- fs.c.orig	2024-02-25 17:04:42.792873829 +0000
++++ fs.c
+@@ -902,7 +902,7 @@ static int s_clear(synth_t *s)
+   {
+     wave_thread_cancel = 1;
+ #ifdef DO_WAVE_CANCEL
+--   pthread_cancel(wave_thread);
++    pthread_cancel(wave_thread);
+ #endif
+     pthread_cond_signal(&wave_condition); // necessary because we inhibit cancellation while waiting
+   }
diff --git a/eflite/patches/patch-soccon.c b/eflite/patches/patch-soccon.c
new file mode 100644
index 0000000000..f5ab3a7c3a
--- /dev/null
+++ b/eflite/patches/patch-soccon.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-soccon.c,v 1.1 2024/02/25 22:00:09 wiz Exp $
+
+Add string.h inclusion when needed
+
+--- soccon.c.orig	2024-01-14 23:55:06.000000000 +0000
++++ soccon.c
+@@ -10,6 +10,9 @@
+ #include <arpa/inet.h>
+ #include <sys/un.h>
+ #include <unistd.h>
++#ifdef HAVE_STRING_H
++# include <string.h>
++#endif
+ 
+ int sockconnect_unix(const char *fname)
+ {
diff --git a/eflite/patches/patch-sockopen.c b/eflite/patches/patch-sockopen.c
new file mode 100644
index 0000000000..6de99b2918
--- /dev/null
+++ b/eflite/patches/patch-sockopen.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-sockopen.c,v 1.1 2024/02/25 22:00:09 wiz Exp $
+
+Add string.h inclusion when needed
+
+--- sockopen.c.orig	2024-01-14 23:55:06.000000000 +0000
++++ sockopen.c
+@@ -11,6 +11,9 @@
+ #include <sys/stat.h>
+ #include <sys/un.h>
+ #include <syslog.h>
++#ifdef HAVE_STRING_H
++# include <string.h>
++#endif
+ 
+ int sockopen_unix(const char *fname)
+ {
diff --git a/yasr/COMMIT_MSG b/yasr/COMMIT_MSG
new file mode 100644
index 0000000000..ec3cbfb4b7
--- /dev/null
+++ b/yasr/COMMIT_MSG
@@ -0,0 +1,26 @@
+audio/yasr: Update yasr to version 0.0.0.156
+
+Update prepared in wip by adr
+
+Update patches
+Change license
+
+Commits on Aug 5, 2026
+    First pass at porting to MacOS
+Commits on Aug 2, 2026
+    Re-license under the GNU Lesser General Public License v2.1
+Commits on Jul 11, 2026
+    meson: Link with libintl when needed
+    meson: Check for util.h
+    meson: Add Homebrew include directory on MacOS
+Commits on May 24, 2026
+    Parse OSC sequences
+Commits on May 6, 2026
+    win_csi: Ignore intermediate characters
+Commits on Sep 5, 2025
+    Update yasr.conf to account for "special" being deleted
+    Add a "silent window" key binding
+    Allow restricting speech to a particular region of the screen
+Commits on Feb 18, 2025
+    Fix build with speech-dispatcher disabled
+    Fix a prototype
diff --git a/yasr/DESCR b/yasr/DESCR
new file mode 100644
index 0000000000..0c14f7b9a9
--- /dev/null
+++ b/yasr/DESCR
@@ -0,0 +1,7 @@
+YASR ("Yet Another Screen Reader") is an attempt at a lightweight,
+portable screen reader. It works by opening a shell in a pty and
+intercepting all user input/output, maintaining a window of what
+should be on the screen by looking at the codes and text sent to the
+screen. It thus uses no Linuxisms such as /dev/vcsa0 and does not
+necessarily need to be setuid root (the only requirement being that
+the user be able to access the tts device).
diff --git a/yasr/Makefile b/yasr/Makefile
new file mode 100644
index 0000000000..3c816c103e
--- /dev/null
+++ b/yasr/Makefile
@@ -0,0 +1,33 @@
+# $NetBSD: Makefile,v 1.5 2026/09/29 06:03:59 wiz Exp $
+
+COMMITS=	156
+DISTNAME=	yasr-0.0.0.${COMMITS}
+CATEGORIES=	audio
+MASTER_SITES=	${MASTER_SITE_GITHUB:=mgorse/}
+GITHUB_TAG=	4b1799010f0453d822e1d246ef06f5ca204c6bdc
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://github.com/mgorse/yasr
+COMMENT=	Lightweight and portable screen reader
+LICENSE=	gnu-lgpl-v2.1
+
+USE_LANGUAGES=	c
+USE_TOOLS=	pkg-config msgfmt xgettext
+
+# Replace bash with sh in configuration example
+SUBST_CLASSES+=		use-sh
+SUBST_STAGE.use-sh=	pre-configure
+SUBST_MESSAGE.use-sh=	Use sh instead of bash
+SUBST_FILES.use-sh=	yasr/yasr.conf
+SUBST_SED.use-sh=	-e 's,/bin/bash,/bin/sh,'
+
+# Fix eflite path in configuration example
+SUBST_CLASSES+=			fix-eflite
+SUBST_STAGE.fix-eflite=		pre-configure
+SUBST_MESSAGE.fix-eflite=	Fix eflite path
+SUBST_FILES.fix-eflite=		yasr/yasr.conf
+SUBST_SED.fix-eflite=		-e 's,/usr/local/bin/eflite,${PREFIX}/bin/eflite,'
+
+.include "../../devel/meson/build.mk"
+.include "../../audio/speech-dispatcher/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/yasr/PLIST b/yasr/PLIST
new file mode 100644
index 0000000000..494a24d9c7
--- /dev/null
+++ b/yasr/PLIST
@@ -0,0 +1,6 @@
+@comment $NetBSD: PLIST,v 1.1 2024/03/11 07:52:38 wiz Exp $
+bin/yasr
+man/man1/yasr.1
+share/locale/es/LC_MESSAGES/yasr.mo
+share/locale/fr/LC_MESSAGES/yasr.mo
+share/yasr/yasr.conf
diff --git a/yasr/distinfo b/yasr/distinfo
new file mode 100644
index 0000000000..d7919c23aa
--- /dev/null
+++ b/yasr/distinfo
@@ -0,0 +1,9 @@
+$NetBSD: distinfo,v 1.1 2024/03/11 07:52:38 wiz Exp $
+
+BLAKE2s (yasr-0.0.0.156-4b1799010f0453d822e1d246ef06f5ca204c6bdc.tar.gz) = 8295f71eb9af1adf5911e5cad999fe8df1367d9f24bb26a5b84cac827a61c135
+SHA512 (yasr-0.0.0.156-4b1799010f0453d822e1d246ef06f5ca204c6bdc.tar.gz) = a6aeac2e684c68ac4adedd2d10dd034877c1028f7b391476e34f72ea82d92b0411e30e49971e74502ea69880b7205e8177a3e7b720387fc2420b2092b52ba1fc
+Size (yasr-0.0.0.156-4b1799010f0453d822e1d246ef06f5ca204c6bdc.tar.gz) = 100866 bytes
+SHA1 (patch-meson.build) = a6df4edfa35fbfb863e42a3e6a7c33e5edcc2d2c
+SHA1 (patch-yasr_main.c) = db9c480d97a3ca20ada091696f8a1fa0030115b2
+SHA1 (patch-yasr_tts.c) = c96764b76e176c7fda5aa166831d647a70b6c382
+SHA1 (patch-yasr_yasr.h) = c36abd284d8d7e80766131b4332cfe527fab455b
diff --git a/yasr/patches/patch-meson.build b/yasr/patches/patch-meson.build
new file mode 100644
index 0000000000..dc7229a722
--- /dev/null
+++ b/yasr/patches/patch-meson.build
@@ -0,0 +1,15 @@
+$NetBSD: patch-meson.build,v 1.1 2024/03/11 07:52:38 wiz Exp $
+
+Add test for necessary headers
+
+--- meson.build.orig	2026-08-05 17:05:38.000000000 +0000
++++ meson.build
+@@ -42,7 +42,7 @@ foreach h : [ 'fcntl.h', 'sys/ioctl.h', 'sys/time.h', 
+ conf.set_quoted('LOCALEDIR', localedir)
+ 
+ foreach h : [ 'fcntl.h', 'sys/ioctl.h', 'sys/time.h', 'unistd.h',  'utmpx.h',
+-  'pty.h', 'locale.h', 'util.h']
++  'pty.h', 'locale.h', 'util.h', 'libutil.h' ]
+   if cc.check_header(h)
+     conf.set('HAVE_@0@'.format(h.underscorify().to_upper()), 1)
+   endif
diff --git a/yasr/patches/patch-yasr_main.c b/yasr/patches/patch-yasr_main.c
new file mode 100644
index 0000000000..a7eaae7c20
--- /dev/null
+++ b/yasr/patches/patch-yasr_main.c
@@ -0,0 +1,1072 @@
+$NetBSD: patch-yasr_main.c,v 1.1 2024/03/11 07:52:38 wiz Exp $
+
+Remove non-portable use of WCHAR_T in iconv code.
+Remove the enforcing of UTF-8 (but the code is expeting multibyte
+encodings or ASCII).
+Fix the reading of char after space using right cursor key.
+Use defined constants in buffer sizes when they are used elsewhere.
+Remove unused argument of gulp().
+Fix bug: buf[] used instead of kbuf[].
+Fix bug: the reading of master can be truncated even just getting one char at
+a time (bug in NetBSD's pty implementation?), the code has to take that
+into account.
+Simplify formatting now that we are there, but according to the rest of the code.
+
+--- yasr/main.c.orig	2026-08-05 17:05:38.000000000 +0000
++++ yasr/main.c
+@@ -42,8 +42,10 @@ char *conffile = NULL;
+ static int size, wsize;
+ static int master, slave;
+ char *conffile = NULL;
+-unsigned char buf[256];
+-wchar_t wide_buf[256];
++#define BUF_SIZE 256
++#define WIDE_BUF_SIZE 256
++char buf[BUF_SIZE];
++wchar_t wide_buf[WIDE_BUF_SIZE];
+ char usershell[OPT_STR_SIZE];
+ static struct termios t;
+ Win *win;
+@@ -53,9 +55,10 @@ static int speaking = 1;
+ Ui ui;
+ Uirev rev;
+ static int speaking = 1;
+-int kbuf[100];
++#define KBUF_SIZE 100
++int kbuf[KBUF_SIZE];
+ int kbuflen = 0;
+-static wchar_t okbuf[100];
++static wchar_t okbuf[KBUF_SIZE];
+ static int okbuflen = 0;
+ static int oldcr = 0, oldcc = 0, oldch = 0;
+ Voices voices;
+@@ -311,40 +314,22 @@ getkey_buf ()
+ static int
+ getkey_buf ()
+ {
+-  char *b1, *b2;
+-  size_t s1, s2;
+   wchar_t ch;
+   int key;
+   int result;
+ 
+-  s1 = size;
+-  s2 = sizeof (wchar_t);
+-  b1 = (char *) buf;
+-  b2 = (char *) &ch;
+-  iconv (ih_inp, NULL, NULL, NULL, NULL);
+-  result = iconv (ih_inp, &b1, &s1, &b2, &s2);
+-  if (result != -1)
+-  {
+-    if (!s1)
+-      return ch;
+-  }
++  result = mbtowc(&ch, buf, size);
++  if (result == size && result != -1)
++    return (int)ch;
+   key = (int) buf[0];
+   if (size > 1)
+-  {
+     key = (key << 8) + buf[1];
+-  }
+   if (size > 2)
+-  {
+     key = (key << 8) + buf[2];
+-  }
+   if (size > 3)
+-  {
+     key = (key << 8) + buf[3];
+-  }
+   if (key >> 8 == 0x1b4f)
+-  {
+     key += 0x000c00;
+-  }
+ 
+   /* Convert high-bit meta keys to escape form */
+ #ifndef __linux__
+@@ -359,11 +344,9 @@ getinput ()
+ {
+   int key;
+ 
+-  size = read (0, buf, 255);
++  size = read (0, buf, BUF_SIZE);
+   if (size <= 0)
+-  {
+     finish (0);
+-  }
+   key = getkey_buf ();
+   if (key == ui.disable)
+   {
+@@ -389,9 +372,7 @@ getinput ()
+ 
+   tts_silence ();
+   if (ui.silent == -1)
+-  {
+     ui.silent = 0;
+-  }
+   ui.silent = -ui.silent;
+   if (ui.meta)
+   {
+@@ -405,9 +386,7 @@ getinput ()
+     okbuflen = tts.oflag = 0;
+   }
+   if (!ui_keypress (key))
+-  {
+     (void) write (master, buf, size);
+-  }
+ }
+ 
+ static void
+@@ -422,9 +401,7 @@ wincpy (Win ** d, Win * s)
+   (*d)->cc = s->cc;
+   (*d)->mode = s->mode;
+   for (i = 0; i < s->rows; i++)
+-  {
+     (void) memcpy ((*d)->row[i], s->row[i], s->cols * CHARSIZE);
+-  }
+   (void) memcpy (&(*d)->savecp, &s->savecp, sizeof (Curpos));
+ }
+ 
+@@ -434,9 +411,7 @@ win_end (Win * win)
+   int i;
+ 
+   for (i = 0; i < win->rows; i++)
+-  {
+     free (win->row[i]);
+-  }
+   free (win->row);
+   free (win->tab);
+ }
+@@ -454,9 +429,7 @@ win_scrollup ()
+   tmpc = win->row[win_scrollmin];
+   (void) memset (tmpc, 0, win->cols * CHARSIZE);
+   for (i = win_scrollmin; i < win_scrollmax; i++)
+-  {
+     win->row[i] = win->row[i + 1];
+-  }
+   win->row[i] = tmpc;
+   win->cr--;
+ }
+@@ -476,9 +449,7 @@ win_lf ()
+     tmpc = win->row[win_scrollmin];
+     (void) memset (tmpc, 0, win->cols * CHARSIZE);
+     for (i = win_scrollmin; i < win_scrollmax; i++)
+-    {
+       win->row[i] = win->row[i + 1];
+-    }
+     win->row[i] = tmpc;
+     win->cr--;
+   }
+@@ -494,9 +465,7 @@ win_scrolldown ()
+   tmpc = win->row[win_scrollmax];
+   (void) memset (tmpc, 0, CHARSIZE * win->cols);
+   for (i = win_scrollmax - 1; i >= win->cr; i--)
+-  {
+     win->row[i + 1] = win->row[i];
+-  }
+   win->row[win->cr] = tmpc;
+ }
+ 
+@@ -537,41 +506,44 @@ oldgulp (unsigned char *buf, int *size, unsigned char 
+     if (ep)
+     {
+       n = buf + *size - *ep;
+-      (void) memmove (buf, *ep, 256 - n);
+-      *size = n + read (master, buf + n, 255 - n);
++      (void) memmove (buf, *ep, BUF_SIZE - n);
++      *size = n + read (master, buf + n, BUF_SIZE - 1  - n);
+       buf[*size] = '\0';
+       (void) write (1, buf + n, *size - n);
+       *ep = buf;
+       return ((char *) buf + n);
+     }
+-    *size = read (master, buf, 255);
++    *size = read (master, buf, BUF_SIZE - 1);
+     buf[*size] = '\0';
+     (void) write (1, buf, *size);
+     return ((char *) buf);
+   }
+-  *size += read (master, buf + *size, 255 - *size);
++  *size += read (master, buf + *size, BUF_SIZE - 1 - *size);
+   buf[*size] = '\0';
+   return ((char *) (buf + os));
+ }
+ 
+ #endif
+ 
+-/*!
++/*
+ function reads portion of data into buf and converts
+ to wide string, leaving 'leave' character in wide_buf;
+ */
+-static int bytes_left;
++static int bytes_left = 0;
+ static char *bytes_left_start;
+ static void
+ read_buf (int leave)
+ {
+-  char *b1, *b2;
+-  size_t s1, s2;
+-  if (bytes_left)
+-  {
+-    memcpy (buf, bytes_left_start, bytes_left);
++  int mbcharsize;
++  char *mbb;
++  wchar_t *wcb, tmpb[WIDE_BUF_SIZE];
++  size_t mbs;
++
++  if (bytes_left){
++    memcpy (tmpb, bytes_left_start, bytes_left);
++    memcpy (buf, tmpb, bytes_left);
+   }
+-  size = read (master, buf + bytes_left, 255 - bytes_left - leave);
++  size = read (master, buf + bytes_left, BUF_SIZE - bytes_left - 1);
+   if (size < 0)
+   {
+     perror ("read");
+@@ -581,39 +553,43 @@ read_buf (int leave)
+   size += bytes_left;
+   buf[size] = 0;
+   bytes_left = 0;
+-  b1 = (char *) buf;
+-  b2 = (char *) (wide_buf + leave);
+-  if (leave)
+-    memcpy (wide_buf, wide_buf + wsize - leave,
+-	    sizeof (wchar_t) * (wsize - leave));
+-  s1 = size;
+-  s2 = (255 - leave) * sizeof (wchar_t);
+-  while (s1 > 0)
++  mbb = buf;
++  wcb = wide_buf + leave;
++  if (leave != 0 && leave < wsize){
++    memcpy (tmpb, wide_buf + wsize - leave, sizeof (wchar_t) * leave);
++    memcpy (wide_buf, tmpb, sizeof (wchar_t) * leave);
++  }
++  mbs = size;
++  wsize = leave;
++  while (mbs > 0 && wsize < (WIDE_BUF_SIZE - 1))
+   {
+-
+-    iconv (ih_inp, NULL, NULL, NULL, NULL);
+-    if (iconv (ih_inp, &b1, &s1, &b2, &s2) == (size_t) -1)
++    mbcharsize = mbrtowc (wcb, mbb, mbs, NULL);
++    /* '\0's will not be copyed to wide_buf */
++    if (mbcharsize <= 0)
+     {
+-      if (errno == EINVAL)	/* incomplete sequence at end of buffer */
+-      {
+-	break;
+-      }
++      if (mbcharsize == (size_t)-2)    /* incomplete sequence at end of buffer */
++        break;
+       /* invalid multibyte sequence - should we ignore or insert
+          some character meaning 'invalid'? */
+-      b1++;
+-      s1--;
++      mbb++;
++      mbs--;
++      continue;
+     }
++    wcb++;
++    wsize++;
++    mbb += mbcharsize;
++    mbs -= mbcharsize;
+   }
+-  bytes_left = s1;
+-  bytes_left_start = b1;
+-  wsize = (wchar_t *) b2 - wide_buf;
+-  wide_buf[wsize] = 0;
++  bytes_left = mbs;
++  bytes_left_start = mbb;
++  wide_buf[wsize] = L'\0';
+ }
+ 
+ static wchar_t *
+-gulp (wchar_t *cp, wchar_t **ep)
++gulp (wchar_t **ep)
+ {
+   int leave;
++
+   if (!ep)
+     leave = 0;
+   else
+@@ -623,7 +599,7 @@ gulp (wchar_t *cp, wchar_t **ep)
+   read_buf (leave);
+   if (ep)
+     *ep = wide_buf;
+-  return wide_buf;
++  return wide_buf + leave;
+ }
+ 
+ static void
+@@ -631,12 +607,10 @@ kbsay ()
+ {
+   if (!ui.kbsay)
+     return;
+-  if (buf[0] == 8 || kbuf[0] == 127)
++  if (kbuf[0] == 8 || kbuf[0] == 127)
+   {
+     if ((ui.kbsay == 2) && (okbuflen != 0))
+-    {
+       okbuf[--okbuflen] = 0;
+-    }
+ 
+     /*tts_say(_("back")); */
+     return;
+@@ -648,10 +622,8 @@ kbsay ()
+   }
+ 
+   /* ui.kbsay == 2 -- handle word echo */
+-  if (okbuflen < sizeof (kbuf) - 1 && is_char (kbuf[0]))
+-  {
++  if (okbuflen < KBUF_SIZE - 1 && is_char (kbuf[0]))
+     okbuf[okbuflen++] = kbuf[0];
+-  }
+ }
+ 
+ #define MIN(a, b) ((a)>(b)? (b): (a))
+@@ -660,9 +632,7 @@ strwtol (wchar_t **p)
+ {
+   long t = 0;
+   while (iswdigit (**p))
+-  {
+     t = 10 * t + *(*p)++ - '0';
+-  }
+   return t;
+ }
+ 
+@@ -675,24 +645,33 @@ win_csi (wchar_t **pp)
+   int i;
+   int x;
+ 
++  /* last gulp could be just 1 char... */
++
++  if (!**pp)
++  {
++    if (!gulp (NULL))
++      return;
++    *pp = wide_buf;
++  }
++
+   p = *pp;
++
+   if (*p == '[')
+     p++;
++
++  if (!*p && !(p = gulp (pp)))
++    return;
+   if (*p == '?')
+     p++;
+   while (!*p || iswdigit ((int) *p) || *p == ';')
+   {
+     if (!*p)
+     {
+-      if (!(p = gulp (p, pp)))
+-      {
+-	return;
+-      }
++      if (!(p = gulp (pp)))
++        return;
+     }
+     else
+-    {
+       p++;
+-    }
+   }
+   p = *pp;
+   if (*p == '[')
+@@ -701,9 +680,7 @@ win_csi (wchar_t **pp)
+     p++;
+   }
+   if (*p == '?')
+-  {
+     p++;
+-  }
+   (void) memset (&parm, 0, sizeof (int) * 16);
+   while (numparms < 16 && (*p == ';' || iswdigit ((int) *p)))
+   {
+@@ -713,15 +690,11 @@ win_csi (wchar_t **pp)
+     else
+       break;			/* TODO: is this redundant? */
+   }
+-
+   if (*p >= 0x20&& *p <= 0x2f)
+     p++;
+-
+   *pp = p + 1;
+   if (ignore)
+-  {
+     return;
+-  }
+   switch (*p)
+   {
+   case '@':			/* insert characters */
+@@ -734,9 +707,7 @@ win_csi (wchar_t **pp)
+   case 'A':			/* move up */
+     win->cr -= PARM1;
+     if (win->cr < 0)
+-    {
+       win->cr = 0;
+-    }
+     break;
+ 
+   case 'B':			/* move down */
+@@ -787,24 +758,18 @@ win_csi (wchar_t **pp)
+       (void) memset (win->row[win->cr] + win->cc, 0,
+ 		     CHARSIZE * (win->cols - win->cc));
+       for (i = win->cr + 1; i < win->rows; i++)
+-      {
+-	(void) memset (win->row[i], 0, win->cols * CHARSIZE);
+-      }
++        (void) memset (win->row[i], 0, win->cols * CHARSIZE);
+       break;
+ 
+     case 1:			/* erase from start to cursor */
+       (void) memset (win->row[win->cr], 0, win->cc);
+       for (i = 0; i < win->cr; i++)
+-      {
+-	(void) memset (win->row[i], 0, win->cols * CHARSIZE);
+-      }
++        (void) memset (win->row[i], 0, win->cols * CHARSIZE);
+       break;
+ 
+     case 2:			/* erase whole screen */
+       for (i = 0; i < win->rows; i++)
+-      {
+-	(void) memset (win->row[i], 0, win->cols * CHARSIZE);
+-      }
++        (void) memset (win->row[i], 0, win->cols * CHARSIZE);
+       break;
+     }
+     break;
+@@ -830,29 +795,19 @@ win_csi (wchar_t **pp)
+   case 'L':			/* insert rows */
+     x = MIN (PARM1, win_scrollmax - win->cr);
+     for (i = win_scrollmax; i >= win->cr + x; i--)
+-    {
+       (void) memcpy (win->row[i], win->row[i - x], win->cols * CHARSIZE);
+-    }
+     for (i = win->cr; i < win->cr + x; i++)
+-    {
+       (void) memset (win->row[i], 0, win->cols * CHARSIZE);
+-    }
+     break;
+ 
+   case 'M':
+     x = MIN (PARM1, win_scrollmax - win->cr);
+     if (x + win->cr > win_scrollmax)
+-    {
+       x = win_scrollmax - win->cr;
+-    }
+     for (i = win->cr; i <= win_scrollmax - x; i++)
+-    {
+       (void) memcpy (win->row[i], win->row[i + x], win->cols * CHARSIZE);
+-    }
+     for (i = win_scrollmax - x + 1; i <= win_scrollmax; i++)
+-    {
+       (void) memset (win->row[i], 0, win->cols * CHARSIZE);
+-    }
+     break;
+ 
+   case 'P':			/* delete characters */
+@@ -865,16 +820,12 @@ win_csi (wchar_t **pp)
+ 
+   case 'S':			/* Scroll up */
+     for (i = 0; i < PARM1; i++)
+-    {
+       win_scrollup ();
+-    }
+     break;
+ 
+   case 'T':			/* Scroll down */
+     for (i = 0; i < PARM1; i++)
+-    {
+       win_scrolldown ();;
+-    }
+     break;
+ 
+   case 'X':			/* Erase characters */
+@@ -891,9 +842,7 @@ win_csi (wchar_t **pp)
+     {
+     case 3:
+       for (i = 0; i < win->cols; i++)
+-      {
+-	win->tab[i] = 0;
+-      }
++        win->tab[i] = 0;
+       break;
+ 
+     case 0:
+@@ -963,13 +912,9 @@ win_csi (wchar_t **pp)
+   }
+ 
+   if (win->cr >= win->rows)
+-  {
+     win->cr = win->rows - 1;
+-  }
+   else if (win->cr < 0)
+-  {
+     win->cr = 0;
+-  }
+   if (win->cc >= win->cols - 1)
+     win->cc = win->cols - 1;
+   else if (win->cc < 0)
+@@ -988,7 +933,7 @@ win_osc (wchar_t **pp)
+   {
+     if (!*p)
+     {
+-      if (!(p = gulp (p, pp)))
++      if (!(p = gulp (pp)))
+ 	return;
+     }
+       p++;
+@@ -1008,20 +953,14 @@ win_addchr (wchar_t ch, int tflag)
+     win->carry++;
+   }
+   if (win->mode & 0x08)
+-  {
+     (void) memmove (win->row[win->cr] + win->cc + 1,
+ 		    win->row[win->cr] + win->cc,
+ 		    (win->cols - win->cc - 1) * CHARSIZE);
+-  }
+   win->row[win->cr][win->cc].attr = win->attr;
+   win->row[win->cr][win->cc++].wchar = ch;
+   if (tflag)
+-  {
+     if (ui.silent != 1)
+-    {
+       tts_addchr (ch);
+-    }
+-  }
+ }
+ 
+ wchar_t
+@@ -1041,12 +980,8 @@ bol (int cr, int cc)
+ 
+   rptr = win->row[cr];
+   for (i = 0; i < cc; i++)
+-  {
+     if (y_isblank (rptr[i].wchar))
+-    {
+       return (0);
+-    }
+-  }
+ 
+   return (1);
+ }
+@@ -1061,12 +996,8 @@ eol (int cr, int cc)
+ 
+   rptr = win->row[cr];
+   for (i = cc + 1; i < win->cols; i++)
+-  {
+     if (y_isblank (rptr[i].wchar))
+-    {
+       return (0);
+-    }
+-  }
+ 
+   return (1);
+ }
+@@ -1082,16 +1013,10 @@ firstword (int cr, int cc)
+   rptr = win->row[cr];
+   i = cc;
+   while (i && !y_isblank (rptr[i].wchar))
+-  {
+     i--;
+-  }
+   for (; i; i--)
+-  {
+     if (!y_isblank (rptr[i].wchar))
+-    {
+       return (0);
+-    }
+-  }
+ 
+   return (1);
+ }
+@@ -1106,20 +1031,12 @@ lastword (int cr, int cc)
+ 
+   rptr = win->row[cr];
+   if (y_isblank (rptr[i].wchar))
+-  {
+     i++;
+-  }
+   while (i < win->cols && !y_isblank (rptr[i].wchar))
+-  {
+     i++;
+-  }
+   while (i < win->cols)
+-  {
+     if (!y_isblank (rptr[i++].wchar))
+-    {
+       return (0);
+-    }
+-  }
+ 
+   return (1);
+ }
+@@ -1143,14 +1060,13 @@ getoutput ()
+   static int stathit = 0, oldoflag = 0;
+ 
+   read_buf (0);
++
+ #ifdef TERMTEST
+   (void) printf ("size=%d buf=%s\n", size, buf);
+ #endif
+ 
+   if (!size)
+-  {
+     finish (0);
+-  }
+   p = wide_buf;
+ 
+   while (p - wide_buf < wsize)
+@@ -1163,37 +1079,33 @@ getoutput ()
+ 
+     case 8:
+       if (win->cc)
+-	win->cc--;
++        win->cc--;
+       else if (win->carry && win->cr)
+       {
+-	win->cr--;
+-	win->cc = win->cols - 1;
+-	win->carry--;
++        win->cr--;
++        win->cc = win->cols - 1;
++        win->carry--;
+       }
+       if ((kbuf[0] == 8 || kbuf[0] == 127) && !tts.oflag && !ui.silent)
+       {
+-	kbsay ();
+-	ui_saychar (win->cr, win->cc);
++        kbsay ();
++        ui_saychar (win->cr, win->cc);
+       }
+       if (tts.outlen)
+-      {
+-	tts.outlen--;
+-      }
++        tts.outlen--;
+       break;
+ 
+     case 9:
+       for (i = win->cc + 1; i < win->cols; i++)
+       {
+-	if (win->tab[i])
+-	{
+-	  win->cc = i;
+-	  break;
+-	}
++        if (win->tab[i])
++        {
++          win->cc = i;
++          break;
++        }
+       }
+       if (i == win->cols)
+-      {
+-	win->cc = i - 1;
+-      }
++        win->cc = i - 1;
+       break;
+ 
+     case 10:
+@@ -1211,36 +1123,34 @@ getoutput ()
+       break;			/* may need to change in the future */
+ 
+     case 27:
+-      if (!*p && !(p = gulp (p, NULL)))
+-      {
+-	return;
+-      }
++      if (!*p && !(p = gulp (NULL)))
++        return;
+       switch (*p++)
+       {
+       case 'D':
+-	win_lf ();
+-	break;
++        win_lf ();
++        break;
+       case 'E':
+-	break;			/* FIXME -- new line */
++        break;			/* FIXME -- new line */
+       case 'H':
+-	win->tab[win->cc] = 1;
+-	break;
++       win->tab[win->cc] = 1;
++       break;
+       case 'M':
+-	win_rlf ();
+-	break;
++        win_rlf ();
++        break;
+       case '7':
+-	wincpy (&winsave, win);
+-	oldcr = oldcc = 255;
+-	break;
++        wincpy (&winsave, win);
++        oldcr = oldcc = 255;
++        break;
+       case '8':
+-	wincpy (&win, winsave);
+-	break;
++        wincpy (&win, winsave);
++        break;
+       case '[':
+-	win_csi (&p);
+-	break;
++        win_csi (&p);
++        break;
+       case ']':
+-	win_osc (&p);
+-	break;
++        win_osc (&p);
++	    break;
+       }
+       break;
+ 
+@@ -1252,37 +1162,27 @@ getoutput ()
+ #if 0
+       if (special)
+       {
+-	if (ch == '<')
+-	{
+-	  speaking = 0;		/* hack for medievia.com */
+-	}
+-	else if (ch == '>')
+-	{
+-	  speaking = 1;
+-	}
++        if (ch == '<')
++          speaking = 0;		/* hack for medievia.com */
++        else if (ch == '>')
++          speaking = 1;
+       }
+ #endif
+       if (ch == kbuf[0] && win->cr == oldcr && win->cc == oldcc && kbuflen)
+       {
+ /* this character was (probably) echoed as a result of a keystroke */
+-	kbsay ();
+-	win_addchr (ch, 0);
+-	(void) memmove (kbuf, kbuf + 1, (--kbuflen) * sizeof (int));
++        kbsay ();
++        win_addchr (ch, 0);
++        (void) memmove (kbuf, kbuf + 1, (--kbuflen) * sizeof (int));
+       }
+       else
+-      {
+-	win_addchr (ch, speaking && in_speaking_window ());
+-      }
++        win_addchr (ch, speaking && in_speaking_window ());
+       chr = 1;
+     }
+     if (!chr && ch != 8 && (stathit == 0 || ch < '0' || ch > '9'))
+-    {
+       tts_flush ();
+-    }
+     else
+-    {
+       chr = 0;
+-    }
+     if ((!win->cc && win->cr > win->rows - 3) || win->cr == win->rows - 1)
+     {
+       stathit = win->cr;
+@@ -1294,10 +1194,17 @@ getoutput ()
+       tts.oflag = oldoflag;
+     }
+   }
+-  if (ch == 13 || ch == 10 || ch == 32)
++  /* If last key was cursor left or cursor right just say char at cursor */
++  if (kbuf[0] == 0x1b5b43 || kbuf[0] == 0x1b5b44)
+   {
+-    tts_flush ();
++    ui_saychar (win->cr, win->cc);
++    oldcr = win->cr;
++    oldcc = win->cc;
++    oldch = win->row[win->cr][win->cc].wchar;
++    return;
+   }
++  if (ch == 13 || ch == 10 || ch == 32)
++    tts_flush ();
+   if (size > 1)
+   {
+     if (!readable (master, 0))
+@@ -1306,9 +1213,7 @@ getoutput ()
+       return;
+   }
+   else if (ch == 32 || ch == 13)
+-  {
+     tts_flush ();
+-  }
+   if (tts.oflag || kbuf[0] == 13 || kbuf[0] == 3 || ui.silent)
+   {
+     tts.oflag = stathit = 0;
+@@ -1329,25 +1234,18 @@ getoutput ()
+     case 1:			/* cursor moved right one character */
+       if ((realchar (win->row[win->cr][win->cc - 1].wchar) == kbuf[0] &&
+ 	   realchar (oldch) != kbuf[0]) ||
+-	  ((y_isblank (oldch) && kbuf[0] == 32)))
+-      {
+-	break;
+-      }
+-      if (kbuf[0] == 0x1b5b43 ||
+-	  ((ui.curtrack == 2) && (ui.kbsay != 2 || is_separator (kbuf[0]))))
+-      {
+-	ui_saychar (win->cr, win->cc);
+-      }
++                 ((y_isblank (oldch) && kbuf[0] == 32)))
+       break;
++      if (ui.curtrack == 2 && (ui.kbsay != 2 || is_separator (kbuf[0])))
++        ui_saychar (win->cr, win->cc);
++      break;
+ 
+     case 0:
+       break;
+ 
+     case -1:
+-      if (kbuf[0] == 0x1b5b44 || ui.curtrack == 2)
+-      {
++      if (ui.curtrack == 2)
+ 	ui_saychar (win->cr, win->cc);
+-      }
+       break;
+ 
+     default:
+@@ -1356,18 +1254,11 @@ getoutput ()
+ 	if (eol (win->cr, win->cc))
+ 	  ui_saychar (win->cr, win->cc);
+ 	else
+-	{
+ 	  ui_sayword (win->cr, cblank (win->cr, win->cc) ?
+ 		      win->cc + 1 : win->cc);
+-	}
+       }
+     }
+   }
+-  else if ((kbuf[0] == 0x1b5b43 && bol (win->cr, win->cc)) ||
+-	   (kbuf[0] == 0x1b5b44 && eol (win->cr, win->cc)))
+-  {
+-    ui_saychar (win->cr, win->cc);
+-  }
+   else
+   {
+     switch (win->cr - oldcr)
+@@ -1378,46 +1269,36 @@ getoutput ()
+ 	ui_sayline (win->cr, 1);
+ 	break;
+       }
+-      if (win->cc == 0 && (oldcr == win->cols - 1 || kbuf[0] == 0x1b5b43))
++      if (win->cc == 0 && oldcr == win->cols - 1)
+       {
+-	ui_saychar (win->cr, win->cc);
+-	break;
++        ui_saychar (win->cr, win->cc);
++        break;
+       }
+       if (ui.curtrack < 2)
+-      {
+-	break;
+-      }
++        break;
+       if (win->cc && bol (win->cr, win->cc) && lastword (oldcr, oldcc)
+-	  && oldcc)
+-      {
+-	ui_sayword (win->cr, win->cc);
+-      }
++          && oldcc)
++        ui_sayword (win->cr, win->cc);
+       else
+-      {
+-	ui_sayline (win->cr, 1);
+-      }
++        ui_sayline (win->cr, 1);
+       break;
+     case -1:			/* cursor moved up a line */
+       if (kbuf[0] == 0x1b5b41)
+       {
+-	ui_sayline (win->cr, 1);
+-	break;
++        ui_sayline (win->cr, 1);
++        break;
+       }
+       if (ui.curtrack < 2)
+-	break;
+-      if (win->cc == win->cols - 1 && (oldcr == 0 || kbuf[0] == 0x1b5b44))
+-      {
+-	ui_saychar (win->cr, win->cc);
+-      }
++        break;
++      if (win->cc == win->cols - 1 && oldcr == 0)
++        ui_saychar (win->cr, win->cc);
+       else if (lastword (win->cr, win->cc) &&
+ 	       !firstword (win->cr, win->cc) &&
+ 	       (!win->cc || cblank (win->cr, win->cc - 1)) &&
+ 	       firstword (oldcr, oldcc))
+-      {
+-	ui_sayword (win->cr, win->cc);
+-      }
++        ui_sayword (win->cr, win->cc);
+       else
+-	ui_sayline (win->cr, 1);
++        ui_sayline (win->cr, 1);
+       break;
+     }
+   }
+@@ -1470,18 +1351,14 @@ parent (void *arg)
+       }
+     }
+     if (FD_ISSET (0, &rf))
+-    {
+       getinput ();
+-    }
+     if (FD_ISSET (master, &rf))
+     {
+       getoutput ();
+-      kbuflen = 0;
++      kbuf[0] = kbuflen = 0;
+     }
+     if (FD_ISSET (tts.fd, &rf))
+-    {
+       get_tts_input ();
+-    }
+   }
+   return NULL;
+ }
+@@ -1512,25 +1389,12 @@ main (int argc, char *argv[])
+   bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+   textdomain (GETTEXT_PACKAGE);
+   strcpy (charmap, nl_langinfo (CODESET));
+-  if (!strcmp (charmap, "ANSI_X3.4-1968"))
+-    strcpy (charmap, "UTF-8");
+-
+-  ih_inp = iconv_open ("WCHAR_T", charmap);
+-  if (ih_inp == (iconv_t) - 1)
+-  {
+-    fprintf (stderr, "Codeset %s not supported\n", charmap);
+-    exit (1);
+-  }
+-
+-
+ #endif
+ 
+   if (argv[0][0] == '-')
+     shell = 1;
+   if (isatty (0))
+-  {
+     (void) ioctl (0, TIOCGWINSZ, &winsz);
+-  }
+   if (!winsz.ws_row)
+   {
+     winsz.ws_row = 25;
+@@ -1571,9 +1435,7 @@ main (int argc, char *argv[])
+     }
+   }
+   if (argv[optind])
+-  {
+     subprog = argv + optind;
+-  }
+   readconf ();
+ 
+ #if 0				/* this doesn't work */
+@@ -1581,9 +1443,7 @@ main (int argc, char *argv[])
+   {
+     cp = usershell + strlen (usershell) - 1;
+     while (*cp && *cp != '/')
+-    {
+       cp--;
+-    }
+     cp++;
+     argv[0] = cp;
+     (void) execv (usershell, argv);
+@@ -1672,9 +1532,7 @@ w_speak (wchar_t *ibuf, int len)
+     {
+       olen -= nc;
+       if (olen)
+-      {
+-	tts_out_w (wstart, olen);
+-      }
++        tts_out_w (wstart, olen);
+       olen = 0;
+       while (i < len1 && ibuf[i + 1] == lc)
+       {
+@@ -1690,25 +1548,19 @@ w_speak (wchar_t *ibuf, int len)
+     else
+     {
+       if (!olen)
+-	wstart = ibuf + i;
++        wstart = ibuf + i;
+       olen++;
+       if (ibuf[i] != lc)
+-      {
+-	nc = 0;
+-      }
++        nc = 0;
+       if (!iswalnum (ibuf[i]) &&
+ 	  ibuf[i] != 32 && ibuf[i] != '=' && ibuf[i] >= 0)
+-      {
+-	lc = ibuf[i];
+-      }
++        lc = ibuf[i];
+       else
+ 	lc = 0;
+     }
+   }
+   if (olen)
+-  {
+     tts_out_w (wstart, olen);
+-  }
+ }
+ 
+ #if 0
+@@ -1730,14 +1582,12 @@ speak (char *ibuf, int len)
+     {
+       olen -= nc;
+       if (olen)
+-      {
+-	tts_out ((unsigned char *) obuf, olen);
+-      }
++        tts_out ((unsigned char *) obuf, olen);
+       olen = 0;
+       while (i < len1 && ibuf[i + 1] == lc)
+       {
+-	i++;
+-	nc++;
++        i++;
++        nc++;
+       }
+       tts_saychar (lc);
+       tts_out ((unsigned char *) obuf,
+@@ -1749,26 +1599,20 @@ speak (char *ibuf, int len)
+     {
+       obuf[olen++] = ibuf[i];
+       if (ibuf[i] != lc)
+-      {
+-	nc = 0;
+-      }
++        nc = 0;
+       if (!isalpha ((int) ibuf[i]) && !isdigit ((int) ibuf[i]) &&
+ 	  ibuf[i] != 32 && ibuf[i] != '=' && ibuf[i] >= 0)
+-      {
+-	lc = ibuf[i];
+-      }
++        lc = ibuf[i];
+       else
+-	lc = 0;
++        lc = 0;
+       if (olen > 250 && !nc)
+       {
+-	tts_out ((unsigned char *) obuf, olen);
+-	olen = 0;
++        tts_out ((unsigned char *) obuf, olen);
++        olen = 0;
+       }
+     }
+   }
+   if (olen)
+-  {
+     tts_out ((unsigned char *) obuf, olen);
+-  }
+ }
+ #endif
diff --git a/yasr/patches/patch-yasr_tts.c b/yasr/patches/patch-yasr_tts.c
new file mode 100644
index 0000000000..c10299ad17
--- /dev/null
+++ b/yasr/patches/patch-yasr_tts.c
@@ -0,0 +1,492 @@
+$NetBSD: patch-yasr_tts.c,v 1.1 2024/03/11 07:52:38 wiz Exp $
+
+Remove non-portable use of WCHAR_T in iconv code.
+Fix comment's alignment.
+
+--- yasr/tts.c.orig	2026-08-05 17:05:38.000000000 +0000
++++ yasr/tts.c
+@@ -55,7 +55,8 @@ static Tts_synth synth[] = {
+   {NULL, NULL, NULL, NULL, NULL, FALSE, NULL, NULL},
+ };
+ 
+-static char *dict[256];
++#define DICT_SIZE 256
++static char *dict[DICT_SIZE];
+ static int tts_flushed = 0;
+ 
+ 
+@@ -69,9 +70,7 @@ dict_read (char *buf)
+   {
+     c = strtol (buf, &p, 0);
+     if (c > 255)
+-    {
+       return (1);
+-    }
+     p++;
+   }
+   else
+@@ -90,20 +89,14 @@ dict_write (FILE * fp)
+ {
+   int i;
+ 
+-  for (i = 0; i < 256; i++)
+-  {
++  for (i = 0; i < DICT_SIZE; i++)
+     if (dict[i])
+     {
+       if (i > 31 && i < 127 && i != 35 && i != 91)
+-      {
+-	(void) fprintf (fp, "%c=%s\n", i, dict[i]);
+-      }
++        (void) fprintf (fp, "%c=%s\n", i, dict[i]);
+       else
+-      {
+-	(void) fprintf (fp, "0x%.2x=%s\n", i, dict[i]);
+-      }
++        (void) fprintf (fp, "0x%.2x=%s\n", i, dict[i]);
+     }
+-  }
+ }
+ 
+ 
+@@ -113,9 +106,7 @@ tts_flush ()
+ tts_flush ()
+ {
+   if (tts.outlen)
+-  {
+     w_speak (tts.buf, tts.outlen);
+-  }
+ 
+   tts.outlen = 0;
+ 
+@@ -130,9 +121,7 @@ tts_wait (int usecs)
+   if (usecs != -1 && !readable (tts.fd, usecs))
+     return;
+   while (readable (tts.fd, 0))
+-  {
+     read (tts.fd, buf, sizeof (buf));
+-  }
+ }
+ #endif
+ 
+@@ -142,9 +131,7 @@ tts_silence ()
+   char tmp[1] = { 0 };
+ 
+   if (tts_flushed)
+-  {
+     return;
+-  }
+   tts.obufhead = tts.obuftail = tts.flood = 0;
+ #ifdef ENABLE_SPEECHD
+   if (tts.synth == TTS_SPEECHD)
+@@ -209,17 +196,13 @@ tts_obufout (int x)
+   int oldoflag;
+ 
+   if (!tts.flood)
+-  {
+     opt_queue_empty (2);
+-  }
+   oldoflag = tts.oflag;
+   while (tts.obufhead < tts.obuftail)
+   {
+     len = strlen (tts.obuf + tts.obufhead);
+     if (len > 1024)
+-    {
+       len = 1024;
+-    }
+     len2 = write (tts.fd, tts.obuf + tts.obufhead, len);
+ #ifdef TTSLOG
+     (void) write (ofd, tts.obuf + tts.obufhead, len2);
+@@ -234,9 +217,7 @@ tts_obufout (int x)
+       return;
+     }
+     while (tts.obufhead < tts.obuftail && !tts.obuf[tts.obufhead])
+-    {
+       tts.obufhead++;
+-    }
+   }
+   tts.flood = 0;
+   tts.oflag = oldoflag;
+@@ -251,9 +232,7 @@ tts_addbuf (char *buf, int len, int len2)
+ 
+   tts.flood = 1;
+   if (len2 == -1)
+-  {
+     ptr = buf;
+-  }
+   else
+   {
+     ptr = buf + len2;
+@@ -267,9 +246,7 @@ tts_addbuf (char *buf, int len, int len2)
+       tts.obuf = realloc (tts.obuf, tts.obuflen);
+     }
+     else
+-    {
+       tts_obufpack ();
+-    }
+   }
+   (void) memcpy (tts.obuf + tts.obuftail, ptr, len);
+   tts.obuftail += len;
+@@ -285,13 +262,9 @@ tts_send (char *buf, int len)
+   int len2;
+ 
+   if (!len)
+-  {
+     return;
+-  }
+   if (tts_flushed)
+-  {
+     tts_flushed = 0;
+-  }
+ #ifndef SILENT
+   if (!tts.flood)
+   {
+@@ -302,9 +275,7 @@ tts_send (char *buf, int len)
+ #endif
+ 
+     if (len2 < len)
+-    {
+       tts_addbuf (buf, len, len2);
+-    }
+   }
+   else
+     tts_addbuf (buf, len, 0);
+@@ -327,10 +298,8 @@ unspeakable (unsigned char ch)
+   if (ch < 32)
+     return 1;
+   while (*p)
+-  {
+     if (*p++ == ch)
+       return 1;
+-  }
+   return (0);
+ }
+ 
+@@ -438,26 +407,24 @@ tts_out_w (wchar_t *buf, int len)
+     while (len > 0)
+     {
+       if (*buf < 0x80)
+-      {
+-	obuf[obo++] = *buf;
+-      }
++        obuf[obo++] = *buf;
+       else if (*buf < 0x800)
+       {
+-	obuf[obo++] = 0xc0 | (*buf >> 6);
+-	obuf[obo++] = 0x80 | (*buf & 0x3f);
++        obuf[obo++] = 0xc0 | (*buf >> 6);
++        obuf[obo++] = 0x80 | (*buf & 0x3f);
+       }
+       else if (*buf < 0x10000)
+       {
+-	obuf[obo++] = 0xe0 | (*buf >> 12);
+-	obuf[obo++] = 0x80 | ((*buf >> 6) & 0x3f);
+-	obuf[obo++] = 0x80 | (*buf & 0x3f);
++        obuf[obo++] = 0xe0 | (*buf >> 12);
++        obuf[obo++] = 0x80 | ((*buf >> 6) & 0x3f);
++        obuf[obo++] = 0x80 | (*buf & 0x3f);
+       }
+       else
+-	obuf[obo++] = ' ';
++        obuf[obo++] = ' ';
+       if (obo >= 1020)
+       {
+-	tts_out ((unsigned char *) obuf, obo);
+-	obo = 0;
++        tts_out ((unsigned char *) obuf, obo);
++        obo = 0;
+       }
+       buf++;
+       len--;
+@@ -478,63 +445,61 @@ tts_out_w (wchar_t *buf, int len)
+       p++;
+       for (i = 0; i < len; i++)
+       {
+-	if (buf[i] > 255 || unspeakable ((unsigned char) buf[i]))
+-	{
+-	  if (obo > 0 && obuf[obo - 1] != ' ')
+-	  {
+-	    obuf[obo++] = ' ';
+-	    tts_send (obuf, obo);
+-	    obo = 0;
+-	  }
+-	  else if (buf[i] < 256 && dict[buf[i]])
+-	  {
+-	    (void) strcpy (obuf + obo, dict[buf[i]]);
+-	    obo = strlen (obuf);
+-	  }
+-	  obuf[obo++] = 32;
+-	}
+-	else if (xml)
+-	{
+-	  switch (buf[i])
+-	  {
+-	    /* For some reason, &lt; does not work for me with Voxeo */
+-	  case '<':
+-	    strcpy (obuf + obo, " less than ");
+-	    obo += 11;
+-	    break;
+-	  case '>':
+-	    strcpy (obuf + obo, "&gt;");
+-	    obo += 4;
+-	    break;
+-	  case '&':
+-	    strcpy (obuf + obo, "&amp;");
+-	    obo += 5;
+-	    break;
+-	  default:
+-	    obuf[obo++] = buf[i];
+-	    break;
+-	  }
+-	}
+-	else
+-	{
+-	  if (ui.split_caps && i > 0 && iswlower (buf[i - 1])
+-	      && iswupper (buf[i]))
+-	  {
+-	    obuf[obo++] = ' ';
+-	  }
+-	  obuf[obo++] = buf[i];
+-	}
+-	if (obo > (sizeof (obuf) / sizeof (obuf[0])) - 6)
+-	{
+-	  tts_send (obuf, obo);
+-	  obo = 0;
+-	}
++        if (buf[i] > 255 || unspeakable ((unsigned char) buf[i]))
++        {
++          if (obo > 0 && obuf[obo - 1] != ' ')
++          {
++            obuf[obo++] = ' ';
++            tts_send (obuf, obo);
++            obo = 0;
++          }
++          else if (buf[i] < 256 && dict[buf[i]])
++          {
++            (void) strcpy (obuf + obo, dict[buf[i]]);
++            obo = strlen (obuf);
++          }
++          obuf[obo++] = 32;
++        }
++        else if (xml)
++        {
++          switch (buf[i])
++          {
++            /* For some reason, &lt; does not work for me with Voxeo */
++          case '<':
++            strcpy (obuf + obo, " less than ");
++            obo += 11;
++            break;
++          case '>':
++            strcpy (obuf + obo, "&gt;");
++            obo += 4;
++            break;
++          case '&':
++            strcpy (obuf + obo, "&amp;");
++            obo += 5;
++            break;
++          default:
++            obuf[obo++] = buf[i];
++            break;
++          }
++        }
++        else
++        {
++          if (ui.split_caps && i > 0 && iswlower (buf[i - 1])
++              && iswupper (buf[i]))
++          {
++            obuf[obo++] = ' ';
++          }
++          obuf[obo++] = buf[i];
++        }
++        if (obo > (sizeof (obuf) / sizeof (obuf[0])) - 6)
++        {
++          tts_send (obuf, obo);
++          obo = 0;
++        }
+       }
+     }
+     else
+-    {
+       obuf[obo++] = *p;
+-    }
+     p++;
+   }
+   tts_send (obuf, obo);
+@@ -678,9 +643,7 @@ tts_saychar (wchar_t ch)
+ #endif
+ 
+   if (!ch)
+-  {
+     ch = 32;
+-  }
+   if (tts.synth == TTS_SPEECHD || tts.synth == TTS_MAC)
+   {
+ #if defined(ENABLE_SPEECHD) || defined(__APPLE__)
+@@ -700,21 +663,22 @@ tts_saychar (wchar_t ch)
+       tts_printf_ll ("CHAR %c\r\n", ch);
+ #else
+     else if (ch < 0x80)
+-    {
+       tts_printf_ll ("CHAR %c\r\n", ch);
+-    }
+     else
+     {
+-      char buf[8], *cin, *cout;
++      char tmpbuf[MB_CUR_MAX], buf[MB_CUR_MAX], *cin, *cout;
+       size_t l1, l2;
+       iconv_t cd;
+-      cd = iconv_open ("UTF-8", "WCHAR_T");
++      cd = iconv_open ("UTF-8", nl_langinfo (CODESET));
+       if (cd == (iconv_t) - 1)
+-	return;
+-      l1 = sizeof (wchar_t);
+-      l2 = 7;
+-      cin = (char *) &ch;
++        return;
++      l1 = wctomb (tmpbuf, ch);
++      if (l1 == -1)
++        return;
++      l2 = sizeof (buf) - 1;
++      cin = tmpbuf;
+       cout = buf;
++
+       iconv (cd, &cin, &l1, &cout, &l2);
+       iconv_close (cd);
+       *cout = 0;
+@@ -730,7 +694,8 @@ tts_saychar (wchar_t ch)
+     return;
+   }
+   if (!synth[tts.synth].charoff)
+-  {				/* assume on string does everything */
++  {
++    /* assume on string does everything */
+     (void) sprintf (ttsbuf, synth[tts.synth].charon, ch);
+     tts_send (ttsbuf, strlen (ttsbuf));
+     return;
+@@ -751,9 +716,7 @@ tts_saychar (wchar_t ch)
+   ttsbuf[0] = ch;
+   tts_send (ttsbuf, 1);
+   if (synth[tts.synth].saychar_needs_flush)
+-  {
+     tts_send (synth[tts.synth].say + 2, strlen (synth[tts.synth].say) - 2);
+-  }
+   while (j)
+   {
+     j -= 2;
+@@ -913,9 +876,7 @@ tts_init (int first_call)
+ #ifdef TTSLOG
+   ofd = open ("tts.log", O_WRONLY | O_CREAT);
+   if (ofd == -1)
+-  {
+     perror ("open");
+-  }
+ #endif
+ 
+ #ifdef ENABLE_SPEECHD
+@@ -954,17 +915,11 @@ tts_init (int first_call)
+   else if (tts.port[0] != '|')
+   {
+     if (tts.synth == TTS_DECTALK)
+-    {
+       mode = O_NOCTTY | O_RDWR;
+-    }
+     else if (tts.synth == TTS_EMACSPEAK_SERVER)
+-    {
+       mode = O_WRONLY;
+-    }
+     if (first_call)
+-    {
+       tts.fd = open (portname, mode);
+-    }
+     if (tts.fd == -1)
+     {
+       perror ("tts");
+@@ -992,21 +947,15 @@ tts_init (int first_call)
+     (void) strcpy (buf, tts.port + 1);
+     arg[i = 0] = strtok (buf, " ");
+     while (i < 7)
+-    {
+       if (!(arg[++i] = strtok (NULL, " ")))
+-      {
+-	break;
+-      }
+-    }
++        break;
+ 
+     if (first_call)
+-    {
+       if (openpty (&tts.fd, &tts.fd_slave, NULL, NULL, NULL) == -1)
+       {
+-	perror ("openpty");
+-	exit (1);
++        perror ("openpty");
++        exit (1);
+       }
+-    }
+ 
+     if (!(tts.pid = fork ()))
+     {
+@@ -1023,9 +972,7 @@ tts_init (int first_call)
+     }
+     (void) usleep (10000);
+     if (tts.pid == -1)
+-    {
+       perror ("forkpty");
+-    }
+   }
+   if (tts.synth == TTS_SPEECHD)
+   {
+@@ -1077,10 +1024,8 @@ tts_addchr (wchar_t ch)
+ tts_addchr (wchar_t ch)
+ {
+   tts.buf[tts.outlen++] = ch;
+-  if (tts.outlen > 250)
+-  {
++  if (tts.outlen > TTS_BUF_SIZE)
+     tts_flush ();
+-  }
+ }
+ 
+ 
+@@ -1099,9 +1044,7 @@ tts_initsynth (int *argp)
+     }
+   }
+   if (!ui.silent)
+-  {
+     tts_say (_("Synthesizer reinitialized."));
+-  }
+ }
+ 
+ 
+@@ -1112,9 +1055,7 @@ tts_reinit (int *argp)
+   int pid = tts.pid;
+ 
+   if (pid == 0)
+-  {
+     return;
+-  }
+ 
+   tts.reinit = 1;		/* Start reinit */
+ 
+@@ -1124,20 +1065,14 @@ tts_reinit (int *argp)
+   if (kill (pid, SIGTERM) != 0)
+   {
+     if (errno == ESRCH)
+-    {
+       tts_reinit2 ();
+-    }
+     else
+-    {
+       kill (pid, SIGKILL);
+-    }
+   }
+ 
+   /* wait init completion (tts.fd must be available) */
+   while (tts.reinit)
+-  {
+     usleep (100000);
+-  }
+ }
+ 
+ 
diff --git a/yasr/patches/patch-yasr_yasr.h b/yasr/patches/patch-yasr_yasr.h
new file mode 100644
index 0000000000..5b15246441
--- /dev/null
+++ b/yasr/patches/patch-yasr_yasr.h
@@ -0,0 +1,39 @@
+$NetBSD: patch-yasr_yasr.h,v 1.1 2024/03/11 07:52:38 wiz Exp $
+
+Remove size of array declarations defined elsewhere
+
+--- yasr/yasr.h.orig	2026-08-05 17:05:38.000000000 +0000
++++ yasr/yasr.h
+@@ -127,6 +127,7 @@ enum mpunct
+ };
+ 
+ #define OPT_STR_SIZE 256
++#define TTS_BUF_SIZE 256
+ 
+ typedef struct Tts Tts;
+ struct Tts
+@@ -142,7 +143,7 @@ struct Tts
+   int obufhead, obuflen, obuftail;
+   int oflag;			/* set to 1 every time tts_send is called */
+   int outlen;
+-  wchar_t buf[256];
++  wchar_t buf[TTS_BUF_SIZE];
+   int synth;
+   pid_t pid;
+   char port[OPT_STR_SIZE];
+@@ -313,11 +314,11 @@ extern char *conffile;
+ extern Opt opt[];
+ extern int synthopt;
+ extern char *conffile;
+-extern unsigned char buf[256];
+-extern int kbuf[100];
++extern char buf[];
++extern int kbuf[];
+ extern int kbuflen;
+-extern char usershell[OPT_STR_SIZE];
+-extern char ttsbuf[80];
++extern char usershell[];
++extern char ttsbuf[];
+ extern Voices voices;
+ extern int sw_top, sw_left, sw_bottom, sw_right;
+ extern char charmap[];


Home | Main Index | Thread Index | Old Index