ctwm_app_menu: Work around "emacs being installed results in the

generated ctwmrc containing invalid syntax" problem. Emacs installs
a desktop file called "emacsclient" that contains "doublequotes"
in its exec string. Pending a better solution for dumping escaped
shell lines into the config file, hide or sanitize desktop entires
that might mess up the internal ctwmrc quoting rules.
This commit is contained in:
nia 2022-07-22 17:06:46 +00:00
parent a63bd7e822
commit fdf6cf6310
1 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $NetBSD: ctwm_app_menu,v 1.4 2022/05/09 15:05:18 nia Exp $
# $NetBSD: ctwm_app_menu,v 1.5 2022/07/22 17:06:46 nia Exp $
#
# Copyright (c) 2020-2022 The NetBSD Foundation, Inc.
# All rights reserved.
@ -98,13 +98,18 @@ do_category()
Name=*)
if ! [ -n "$name" ];
then
name=$(printf '%s' "$line" | cut -c6- | tr -d '\r')
name=$(printf '%s' "$line" | cut -c6- | tr -d '\r' | tr -d '"')
fi
;;
Exec=*)
if ! [ -n "$exec" ];
then
exec=$(printf '%s' "$line" | cut -c6- | sed -e 's/ %.*//g' | tr -d '\r')
if printf '%s' "$exec" | grep -q '"'; then
# results in malformed config file, better way
# to handle this...?
nodisplay="true"
fi
fi
;;
Terminal=true)