From: Dana Jansens Date: Fri, 25 May 2007 18:22:45 +0000 (+0000) Subject: only set as many desktop names as we have to X-Git-Tag: release-2.0.2~187 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=5adcf1d7d72431f7b05df10bff2be9a3e6710e5c;p=dana%2Fobconf.git only set as many desktop names as we have to --- diff --git a/src/handlers.c b/src/handlers.c index 4cb395c..749a9d1 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -1229,6 +1229,7 @@ static void set_desktop_names() gchar **s; GList *lit; xmlNodePtr n, c; + gint num = 0, last = -1; n = tree_get_node("desktops/names", NULL); while ((c = n->children)) { @@ -1236,7 +1237,14 @@ static void set_desktop_names() xmlFreeNode(c); } - for (lit = desktop_names; lit; lit = g_list_next(lit)) + for (lit = desktop_names; lit; lit = g_list_next(lit)) { + if (((gchar*)lit->data)[0]) /* not empty */ + last = num; + ++num; + } + + num = 0; + for (lit = desktop_names; lit && num <= last; lit = g_list_next(lit)) xmlNewTextChild(n, NULL, "name", lit->data); tree_apply();