NetBSD Problem Report #60198

From www@netbsd.org  Fri Apr 17 08:33:01 2026
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 "R12" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 58CEA1A923E
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 17 Apr 2026 08:33:01 +0000 (UTC)
Message-Id: <20260417083300.081E81A923F@mollari.NetBSD.org>
Date: Fri, 17 Apr 2026 08:32:59 +0000 (UTC)
From: rwhitlock22@gmail.com
Reply-To: rwhitlock22@gmail.com
To: gnats-bugs@NetBSD.org
Subject: ctwm_app_menu doesn't consder whitespace
X-Send-Pr-Version: www-1.0
X-From4GNATS: "rwhitlock22@gmail.com via gnats" <gnats-admin@NetBSD.org>

>Number:         60198
>Category:       xsrc
>Synopsis:       ctwm_app_menu doesn't consder whitespace
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    xsrc-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 17 08:35:01 +0000 2026
>Last-Modified:  Fri Jun 26 14:20:02 +0000 2026
>Originator:     Robert Whitlock
>Release:        NetBSD 11.99.5 amd64, April 12, 2026
>Organization:
>Environment:
also pkgsrc-2026Q1
>Description:
The /usr/X11R7/libexec/ctwm_app_menu script doesn't consider whitespace around the equals sign. This causes the ctwm menu entry for pkgsrc/editors/dte to show up blank, not run when clicked, and appear in the Misc category instead of Accessories. According to

https://specifications.freedesktop.org/desktop-entry/1.1/basic-format.html#entries

there can be spaces: "Space before and after the equals sign should be ignored"
>How-To-Repeat:
Install pkgsrc/editors/dte
Restart ctwm
See the blank menu entry under Misc
>Fix:
--- ctwm_app_menu.orig  2026-04-13 23:35:43.962212705 -0400
+++ ctwm_app_menu       2026-04-17 04:10:54.884816676 -0400
@@ -33,7 +33,7 @@
 LOCALBASE=$(pkg_info -Q LOCALBASE pkg_install 2>/dev/null) ||
     LOCALBASE=/usr/pkg

-find "$LOCALBASE"/share/applications -name '*.desktop' -exec awk -F= '
+find "$LOCALBASE"/share/applications -name '*.desktop' -exec awk '
        function resetentry() {
                name = menu = exec = ""
                terminal = nodisplay = 0
@@ -55,8 +55,12 @@
                return "\"" s "\""
        }

-       function iskey(k)       { return $1 == k }      # Assumes FS="="
-       function value( v)      { v = $0; sub(/^[^=]*=/, "", v); return v }
+       function iskey(k, loc1) {
+               loc1 = $0
+               sub(/ *=.*$/, "", loc1)
+               return loc1 == k
+       }
+       function value( v)      { v = $0; sub(/^[^=]*= */, "", v); return v }

        BEGIN {
                menuno = 0
@@ -108,9 +112,9 @@
        FNR == 1                { resetentry() }

        iskey("Name") && !name  { name = value() }
-       /^Terminal=true$/       { terminal = 1 }
+       /^Terminal *= *true$/   { terminal = 1 }
        iskey("OnlyShowIn")     { nodisplay = 1 }
-       /^NoDisplay=true$/      { nodisplay = 1 }
+       /^NoDisplay *= *true$/  { nodisplay = 1 }
        iskey("Exec") && !exec  { exec = value()
                                  gsub(/ %.*/, "", exec)
                                  if (exec ~ /\"/)      # XXX

>Audit-Trail:
From: "Nia Alarie" <nia@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60198 CVS commit: src/external/mit/ctwm/libexec
Date: Fri, 17 Apr 2026 11:07:12 +0000

 Module Name:	src
 Committed By:	nia
 Date:		Fri Apr 17 11:07:12 UTC 2026

 Modified Files:
 	src/external/mit/ctwm/libexec: ctwm_app_menu

 Log Message:
 ctwm_app_menu: Handle whitespace around equals sign in ini files

 from Robert Whitlock

 PR xsrc/60198 ctwm_app_menu doesn't consder whitespace


 To generate a diff of this commit:
 cvs rdiff -u -r1.7 -r1.8 src/external/mit/ctwm/libexec/ctwm_app_menu

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

From: Rob Whitlock <rwhitlock22@gmail.com>
To: gnats-bugs@netbsd.org
Cc: xsrc-manager@netbsd.org,
 gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Subject: Re: PR/60198 CVS commit: src/external/mit/ctwm/libexec
Date: Sat, 2 May 2026 12:29:10 -0400

 > On Apr 17, 2026, at 7:10 AM, Nia Alarie <nia@netbsd.org> wrote:
 >=20
 > The following reply was made to PR xsrc/60198; it has been noted by =
 GNATS.
 >=20
 > From: "Nia Alarie" <nia@netbsd.org>
 > To: gnats-bugs@gnats.NetBSD.org
 > Cc:=20
 > Subject: PR/60198 CVS commit: src/external/mit/ctwm/libexec
 > Date: Fri, 17 Apr 2026 11:07:12 +0000
 >=20
 > Module Name:	src
 > Committed By:	nia
 > Date:		Fri Apr 17 11:07:12 UTC 2026
 >=20
 > Modified Files:
 > 	src/external/mit/ctwm/libexec: ctwm_app_menu
 >=20
 > Log Message:
 > ctwm_app_menu: Handle whitespace around equals sign in ini files
 >=20
 > from Robert Whitlock
 >=20
 > PR xsrc/60198 ctwm_app_menu doesn't consder whitespace
 >=20
 >=20
 > To generate a diff of this commit:
 > cvs rdiff -u -r1.7 -r1.8 src/external/mit/ctwm/libexec/ctwm_app_menu
 >=20
 > Please note that diffs are not public domain; they are subject to the
 > copyright notices on the relevant files.

 Thanks for the quick commit. This PR may be closed.

 P.S.: I think the whitespace before the v parameter was intentional,
 where it is meant to indicate that v is used as a local variable
 and not a parameter that you pass when the value function is called.
 But that=E2=80=99s not a big deal. See

 https://www.gnu.org/software/gawk/manual/html_node/Variable-Scope.html

 and page 54 of The AWK Programming Language:

 =E2=80=9CWe put several blanks between the arguments and the local
 variables so they can be distinguished."=

From: Rob Whitlock <rwhitlock22@gmail.com>
To: gnats-bugs@netbsd.org,
 Rob Whitlock via gnats <gnats-admin@NetBSD.org>
Cc: xsrc-manager@netbsd.org,
 netbsd-bugs@netbsd.org
Subject: Re: PR/60198 CVS commit: src/external/mit/ctwm/libexec
Date: Tue, 19 May 2026 04:48:43 -0400

 > On May 2, 2026, at 12:30 PM, Rob Whitlock via gnats =
 <gnats-admin@NetBSD.org> wrote:
 >=20
 > The following reply was made to PR xsrc/60198; it has been noted by =
 GNATS.
 >=20
 > From: Rob Whitlock <rwhitlock22@gmail.com>
 > To: gnats-bugs@netbsd.org
 > Cc: xsrc-manager@netbsd.org,
 > gnats-admin@netbsd.org,
 > netbsd-bugs@netbsd.org
 > Subject: Re: PR/60198 CVS commit: src/external/mit/ctwm/libexec
 > Date: Sat, 2 May 2026 12:29:10 -0400
 >=20
 >> On Apr 17, 2026, at 7:10 AM, Nia Alarie <nia@netbsd.org> wrote:
 >> =3D20
 >> The following reply was made to PR xsrc/60198; it has been noted by =3D=

 > GNATS.
 >> =3D20
 >> From: "Nia Alarie" <nia@netbsd.org>
 >> To: gnats-bugs@gnats.NetBSD.org
 >> Cc:=3D20
 >> Subject: PR/60198 CVS commit: src/external/mit/ctwm/libexec
 >> Date: Fri, 17 Apr 2026 11:07:12 +0000
 >> =3D20
 >> Module Name:	src
 >> Committed By:	nia
 >> Date:		Fri Apr 17 11:07:12 UTC 2026
 >> =3D20
 >> Modified Files:
 >> 	src/external/mit/ctwm/libexec: ctwm_app_menu
 >> =3D20
 >> Log Message:
 >> ctwm_app_menu: Handle whitespace around equals sign in ini files
 >> =3D20
 >> from Robert Whitlock
 >> =3D20
 >> PR xsrc/60198 ctwm_app_menu doesn't consder whitespace
 >> =3D20
 >> =3D20
 >> To generate a diff of this commit:
 >> cvs rdiff -u -r1.7 -r1.8 src/external/mit/ctwm/libexec/ctwm_app_menu
 >> =3D20
 >> Please note that diffs are not public domain; they are subject to the
 >> copyright notices on the relevant files.
 >=20
 > Thanks for the quick commit. This PR may be closed.
 >=20
 > P.S.: I think the whitespace before the v parameter was intentional,
 > where it is meant to indicate that v is used as a local variable
 > and not a parameter that you pass when the value function is called.
 > But that=3DE2=3D80=3D99s not a big deal. See
 >=20
 > https://www.gnu.org/software/gawk/manual/html_node/Variable-Scope.html
 >=20
 > and page 54 of The AWK Programming Language:
 >=20
 > =3DE2=3D80=3D9CWe put several blanks between the arguments and the =
 local
 > variables so they can be distinguished."=3D

 Actually, I think this needs to be pulled up to netbsd-11.

From: Rob Whitlock <rwhitlock22@gmail.com>
To: gnats-bugs@netbsd.org
Cc: xsrc-manager@netbsd.org,
 gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Subject: Re: PR/60198 CVS commit: src/external/mit/ctwm/libexec
Date: Fri, 26 Jun 2026 08:19:10 -0600

 > On May 19, 2026, at 2:50 AM, Rob Whitlock via gnats =
 <gnats-admin@NetBSD.org> wrote:
 >=20
 > Actually, I think this needs to be pulled up to netbsd-11.

 Add netbsd-10 to netbsd-11 for the list of branches to pull this up to.
 (Basically everywhere https://gnats.netbsd.org/59958 was pulled up to.)=

NetBSD Home
NetBSD PR Database Search

(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.