attr_free(setp);
}
+/* make a copy of 'set', keeping only attributes from 'nkey'
+ * onwards. 'nkey' will be the new starting offset.
+ */
struct attrset *attr_copy_tail(struct attrset *set, int nkey)
{
struct attrset *newset = NULL;
v = set->attrs + i;
i += strlen(v) + 1;
n = atoi(k);
-
- if (n <= nkey && *v == '\0')
- v = NULL;
- attr_set_str_key(&newset, k, v, nkey);
+ if (n < nkey)
+ continue;
+ while (*k && *k != ' ')
+ k++;
+ if (*k == ' ')
+ k++;
+
+ attr_set_str_key(&newset, k, v, n-nkey);
}
}