As reported by Coverity (CID #50146), if the function getLocalizedStringValue
returns without matching the entry, the storage for the entry's locale was
leaked.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
From the comments at the top of wmmenugen_parse_xdg.c:
Since there is no passing of file name arguments or anything of the
sort to applications from the menu, execname is determined as follows:
- If `TryExec' is present, use that;
- else use `Exec' with any switches stripped
However, Exec used to be preferred. Changed code to prefer TryExec.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Exec fields in desktop-files may include field-codes which act as
place-holders for command-line arguments. Previously the Exec arguments
were being passed through intact. However, since Window Maker has no
support for expanding the field-codes, we now remove them and preserve
the remaining arguments.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
From https://standards.freedesktop.org/menu-spec/latest/apa.html:
Category-based menus based on the Main Categories listed in this
specification do not provide a complete ontology for all available
applications. Category-based menu implementations SHOULD therefore provide
a "catch-all" submenu for applications that cannot be appropriately placed
elsewhere.
Emphasis on *submenu*. By using 'Applications', these menu entries were
sorted into the top level.
From https://standards.freedesktop.org/menu-spec/latest/apas03.html:
Reserved Categories have a desktop-specific meaning that has not been
standardized (yet). Desktop entry files that use a reserved category MUST
also include an appropriate OnlyShowIn= entry to restrict themselves to
those environments that properly support the reserved category as used.
The specification for XDG menu files allows having more than one group and
assumes no constraint on their order. The original code assumed that once
the proper group marker was found, everything after was part of it, causing
misinterpretation of some data, like taking the wrong launch command.
This patch stops the parsing of the menu XDG file when a new group is
found, hence implementing the expected behaviour.
Reported-by: Andreas Metzler <ametzler@bebt.de>
It makes the code easier to read to explicitly define a type for the
functions that are used for callbacks, so this patch does this for the
wmmenugen tool.
It was an opportunity to highlight some variable definitions that looked
like function prototypes, and were as such misplaced in the code, being a
source of confusion.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Last group from a desktop file is always added to menu regardless of
NoDisplay property. Properly handle the NoDisplay and Hidden properties
at the end of file.
Signed-off-by: Alexey I. Froloff <raorn@raorn.name>
The one in WPrefs.app/Appearance.c is indirect: the function might
be inlined and might return an uninitialized value, which causes gcc to
complain that the caller might use that uninitialized return value.
* Remove assigned but not used variables (GCC 4.6)
* Bump _XOPEN_SOURCE to 600, ridding of FreeBSD warnings (this probably need
to be tweaked on a per-implementation basis as problems arise)
Recognize the freedesktop.org-mandated Main Categories in .desktop files
and put menu entries in the appropriate categories.
Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
Add optional interface parsers may choose to implement that, when
a directory is being scanned for files to parse, may, based on
the file name, decide whether or not said file should be parsed.
Signed-off-by: Tamas TEVESZ <ice@extreme.hu>