[Pkg-wmaker-commits] [wmaker] 01/01: Fix wmmenugen parsing of XDG menu files with more than one group.

Andreas Metzler ametzler at moszumanska.debian.org
Sat Jul 8 09:13:12 UTC 2017


This is an automated email from the git hooks/post-receive script.

ametzler pushed a commit to branch experimental
in repository wmaker.

commit 389925c7af3473e464e55ad632d3a457e356fde6
Author: Andreas Metzler <ametzler at bebt.de>
Date:   Thu Jul 6 19:06:26 2017 +0200

    Fix wmmenugen parsing of XDG menu files with more than one group.
---
 debian/changelog                                   |  3 ++
 ...parsing-of-XDG-menus-with-multiple-groups.patch | 37 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 41 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 3e40116..f52d72a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -59,6 +59,9 @@ wmaker (0.95.8-1~exp2) UNRELEASED; urgency=medium
   [ Andreas Metzler ]
   * Drop Rodolfo García Peñas from uploaders. - Thanks for your work!
     Closes: #866854
+  * 10_util-fix-parsing-of-XDG-menus-with-multiple-groups.patch from upstream
+    GIT next: Fix wmmenugen parsing of XDG menu files with more than one
+    group.
 
  -- Doug Torrance <dtorrance at piedmont.edu>  Thu, 16 Mar 2017 11:07:30 -0400
 
diff --git a/debian/patches/10_util-fix-parsing-of-XDG-menus-with-multiple-groups.patch b/debian/patches/10_util-fix-parsing-of-XDG-menus-with-multiple-groups.patch
new file mode 100644
index 0000000..9528c23
--- /dev/null
+++ b/debian/patches/10_util-fix-parsing-of-XDG-menus-with-multiple-groups.patch
@@ -0,0 +1,37 @@
+From e037ae3684928a2fbf4a3994562a322f5d3b0c71 Mon Sep 17 00:00:00 2001
+From: Christophe CURIS <christophe.curis at free.fr>
+Date: Sun, 2 Jul 2017 23:01:49 +0200
+Subject: [PATCH] util: fix parsing of XDG menus with multiple groups
+
+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 at bebt.de>
+---
+ util/wmmenugen_parse_xdg.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/util/wmmenugen_parse_xdg.c b/util/wmmenugen_parse_xdg.c
+index fc5f6b19..31ee8130 100644
+--- a/util/wmmenugen_parse_xdg.c
++++ b/util/wmmenugen_parse_xdg.c
+@@ -132,6 +132,11 @@ void parse_xdg(const char *file, cb_add_menu_entry *addWMMenuEntryCallback)
+ 			/* start processing group */
+ 			memset(buf, 0, sizeof(buf));
+ 			continue;
++		} else if (p[0] == '[') {
++			/* If we find a new group and the previous group was the main one,
++			 * we stop all further processing
++			 */
++			if (InGroup) break;
+ 		}
+ 
+ 		if (!InGroup) {
+-- 
+2.13.2
+
diff --git a/debian/patches/series b/debian/patches/series
index 1dd2421..73ea661 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
+10_util-fix-parsing-of-XDG-menus-with-multiple-groups.patch
 53_Debian_WMState.diff
 54_Debian_wmmacros.diff

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmaker.git



More information about the Pkg-wmaker-commits mailing list