+/**
+ * pmenu_item_update - Update the label of an existing pmenu_item.
+ *
+ * The item array must be disconnected prior to calling.
+ */
+int pmenu_item_update(struct pmenu_item *item, const char *name)
+{
+ const char *label;
+ ITEM *i;
+
+ if (!item || !item->nci)
+ return -1;
+
+ label = pmenu_item_label(item, name);
+
+ if (!label)
+ return -1;
+
+ i = item->nci;
+ i->name.str = label;
+ i->name.length = strncols(label);
+
+ return 0;
+}
+