aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2013-09-26 14:50:51 +0100
committerRoss Burton <ross.burton@intel.com>2013-09-26 16:16:01 +0100
commitc0b1a2310721d96edbb54279cd6d38bfa30d87dc (patch)
tree0fc9b92ed09e6f5d04ca70646cb5cadaa62ec293
parentbd69c2185c1286cc22e365a3ed20efdf40e8f6e7 (diff)
downloadmatchbox-panel-2-c0b1a2310721d96edbb54279cd6d38bfa30d87dc.tar.gz
matchbox-panel-2-c0b1a2310721d96edbb54279cd6d38bfa30d87dc.tar.bz2
matchbox-panel-2-c0b1a2310721d96edbb54279cd6d38bfa30d87dc.zip
mb-panel: handle consecutive separators
Consecutive separators results in empty strings and NULLs being passed to load_applet() which produces warnings, so handle these cases. Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--matchbox-panel/mb-panel.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/matchbox-panel/mb-panel.c b/matchbox-panel/mb-panel.c
index 2d8cafd..828a36d 100644
--- a/matchbox-panel/mb-panel.c
+++ b/matchbox-panel/mb-panel.c
@@ -110,10 +110,15 @@ load_applets (const char *applets_desc,
applets = g_strsplit (applets_desc, ",", -1);
for (i = 0; applets[i]; i++) {
+ char *s;
char **bits;
GtkWidget *applet;
- bits = g_strsplit (applets[i], ":", 2);
+ s = applets[i];
+ if (s == NULL || s[0] == '\0')
+ continue;
+
+ bits = g_strsplit (s, ":", 2);
applet = load_applet (bits[0],
bits[1],