$ lvs -o name,tags vg/lvol0
LV LV Tags
lvol0 a
Before this patch:
$ lvs -o name,tags vg/lvol0 -S 'tags=[a]'
LV LV Tags
lvol0 a
$ lvs -o name,tags vg/lvol0 -S 'tags=[ab]'
LV LV Tags
lvol0 a
(incorrect!)
$ lvs -o name,tags vg/lvol0 -S 'tags=[abc]'
LV LV Tags
lvol0 a
(incorrect!)
With this patch applied:
$ lvs -o name,tags vg/lvol0 -S 'tags=[a]'
LV LV Tags
lvol0 a
$ lvs -o name,tags vg/lvol0 -S 'tags=[ab]'
(no result - correct!)
$ lvs -o name,tags vg/lvol0 -S 'tags=[abc]'
(no result - correct!)
Version 1.02.89 -
=================================
+ Fix string list selection to match whole words only, not prefixes.
Version 1.02.88 - 5th August 2014
=================================
/* both lists are sorted so they either match 1:1 or not */
dm_list_iterate_items(sel_item, sel->list) {
- if (strncmp(sel_item->str, val->value + val->items[i].pos, val->items[i].len))
+ if ((strlen(sel_item->str) != val->items[i].len) ||
+ strncmp(sel_item->str, val->value + val->items[i].pos, val->items[i].len))
return 0;
i++;
}
* Make use of the fact that the lists are sorted!
*/
for (i = 1; i <= val->items[0].len; i++) {
- if (!strncmp(sel_item->str, val->value + val->items[i].pos, val->items[i].len))
+ if ((strlen(sel_item->str) == val->items[i].len) &&
+ !strncmp(sel_item->str, val->value + val->items[i].pos, val->items[i].len))
return 1;
}
}